user3569140
user3569140

Reputation: 11

Spring Integration Java DSL Example

Could you please provide an example using spring integration java dsl for the following scenario: On receipt of customer id by a topic consumer:

  1. create a pojo CustomerInfo
  2. call a rest service to get customer account info and set to CustomerInfo
  3. call a rest service to get customer order info and set to CustomerInfo
  4. Finally send CustomerInfo to a topic using claim check I used to work with xml config, java dsl is new to me.

I also wanted to check if Mark Fisher is publishing spring integration in action with java dsl.

Upvotes: 1

Views: 953

Answers (1)

Artem Bilan
Artem Bilan

Reputation: 121177

  1. create a pojo CustomerInfo

Nothing more then transform() in Java DSL.

  1. & 3. Perhaps you can use a scatterGather(). Or enrich() twice.

  2. Not sure what does it mean "send using claim check", but probably it is like claimCheckIn() and then handle().

Your use-case is not so straight forward to have as a general sample solution. Therefore unlikely there is a sample for your request.

All the info you needed for Java DSL you can find in Docs: https://docs.spring.io/spring-integration/docs/current/reference/html/dsl.html#java-dsl or just read JavaDocs on the IntegrationFlowDefinition methods to match them to required operator.

Upvotes: 1

Related Questions