Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rest proxy remove block from Schedulers #5376

Merged
merged 9 commits into from
Sep 16, 2019
Merged

Conversation

sima-zhu
Copy link
Contributor

This is the fix which customer reported issue:
#5341

Here is the reactor issue for addressing the problem of invoking Mono/Flux.block calls inside NonBlockingThread.
reactor/reactor-core#1102

response.getDecodedHeaders().block());
return response.getDecodedHeaders()
.defaultIfEmpty(NullObject.INSTANCE)
.map(headers -> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be switched to a flatMap and follow a similar pattern as handleRestResponseReturnType which you changed in the PR as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

map works well in this case and make code less overhead.
I would prefer to keep using map here.

@sima-zhu
Copy link
Contributor Author

/azp run java -storage -tests

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@sima-zhu
Copy link
Contributor Author

/azp run java - storage - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

} catch (IllegalAccessException | InvocationTargetException | InstantiationException e) {
throw logger.logExceptionAsError(Exceptions.propagate(e));
}
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work @sima-zhu :). I learned something today.

Just one question - Do we need an implementation of BiFunction to achieve this? or just a method is sufficient?, something like:

private static Response<?> createResponse(Constructor<? extends Response<?>> ctr, Object[] args) {
    try {
	    return ctor.newInstance(args);
	} catch (IllegalAccessException | InvocationTargetException | InstantiationException e) {
	    throw logger.logExceptionAsError(Exceptions.propagate(e));
	}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think it should be enough. Making functional as it would easy for any lambda function. Since it does not take function as parameter, I agree to convert it to method.

@sima-zhu
Copy link
Contributor Author

/azp run java - storage - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sima-zhu
Copy link
Contributor Author

/azp run java - eventhubs - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sima-zhu
Copy link
Contributor Author

/azp run java - keyvault - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sima-zhu sima-zhu merged commit 4bb9450 into Azure:master Sep 16, 2019
@sima-zhu sima-zhu deleted the fix_restproxy branch February 23, 2021 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants