AMQP: Using the alternative approach for publisher confirms and returns with an integration flow that serves as gateway #11188
|
When using AMQP outbound adapters, there is an alternative approach to publisher confirms and returns, that involves adding correlation data to the message headers, and wait for the future of this correlation data to fulfil. The application code using this approach deals with messages and headers. In our applications, we typically use Gateway-Interfaces that are bound to integration flows, so that the application doesn't deal with messaging specific APIs in the business logic. Is there any way to implement this approach within the integration flow, eg. with an integration component that acts as a kind of interceptor that handles the correlation data and the future? Does anyone have an example or a rough sketch how that could look like? |
Replies: 2 comments 2 replies
|
Not fully clear what is your question. where that So, with the What kind of interceptor you'd like to see if such a logic is handled internally in the |
|
I'll try to find a better way to express the question. If I provide an extra argument in the gateway method with
As this deals with a messaging, and AMQP specific aspect, I would like if there was a way to implement the above logic in some (loosely termed) interceptor within the flow instead of leaving it to the caller of the gateway method. |
Sure! You can avoid that gateway's argument and have a header-enricher just after to put some custom data being represented as a correlation.
Such an info still can be based on the input from the gateway's method.