How to use @Transformer bean with Spring Java DSL integration?

I would like to use a bean using a method annotated with @Transformer to transform a message accessing part of its headers using the @Header annotation. Is there a way to do this using Java DSL (with Java 7, so there is no lambdas)? This is not like that.

+4
source share
2 answers

You can do it as follows:

.handle("myTransformer", "myMethod")

if your transformer does not return Message.

On the other hand, if you are already using @Transformer, you can add attributes channelto create a real endpoint for this method and use these channels from IntegrationFlow, for example..gateway("transformChannel")

1.1 EIP-, .

GH !

+1

...

.transform("@transformerBean.someMethod(payload, headers['foo'])")

... .

0

All Articles