Jackson ObjectMapper VS Spring integration JsonToObjectTransformer()

I got stuck on this and i’d like to clarify it better The default behaviour of Jackson ObjectMapper is to throw exception in front of json properties which can’t be bind in any Java field. // json to bind in java entity { "name":"mike", "surname":"parker", "age":19 } // java entity class Hero { String name;… Read More Jackson ObjectMapper VS Spring integration JsonToObjectTransformer()

How to set ID header in Spring Integration Kafka Message?

I have a demo Spring Integration project which is receiving Kafka messages, aggregating them, and then releasing them. I’m trying to add JdbcMessageStore to the project. The problem is that it failing with error: Caused by: java.lang.IllegalArgumentException: Cannot store messages without an ID header at org.springframework.util.Assert.notNull(Assert.java:201) ~[spring-core-5.2.15.RELEASE.jar:5.2.15.RELEASE] at org.springframework.integration.jdbc.store.JdbcMessageStore.addMessage(JdbcMessageStore.java:314) ~[spring-integration-jdbc-5.3.8.RELEASE.jar:5.3.8.RELEASE] After debugging I found that… Read More How to set ID header in Spring Integration Kafka Message?

Adding a tenant ID header to MessagingGateway for every message sent

I have an abstract class in a library project where I do: this.eventGateway.publishEvent("SomeEvent", null); and EventGateway is this: @MessagingGateway public interface EventGateway { @Gateway(requestChannel = "SomeChannel") void publishEvent(@Header(value = "EventName") String event, @Payload Object payload); } and my SomeChannel definition: @Bean(name = "SomeChannel) public MessageChannel someChannel() { return new PublishSubscribeChannel(Executors.newCachedThreadPool()); } Now it’s been working… Read More Adding a tenant ID header to MessagingGateway for every message sent

Spring Integration Channel works for first time, then does not the second time

When using Spring Integration and Channel to another integration flow, it only works the first time. Then after that it skips over the channel and returns. From first integration flow: .handle((p, h) -> { System.out.println("Payload Before Channel" + p.toString()); return p; }) .channel(IntegrationNamesEnum.JAMS_SUBMIT_JOB_INTGRTN.getChannelName()) .handle((p, h) -> { System.out.println("Payload After Channel" + p.toString()); return p; })… Read More Spring Integration Channel works for first time, then does not the second time