spring - Explicitly declaring service gateway in Java configuration -
spring - Explicitly declaring service gateway in Java configuration -
i have application using spring integration have multiple handlers (strategies) service gateway methods, , want deployment launcher able select specific handlers loaded. since component scanning pick of handlers indiscriminately, prefer explicitly declare javaconfig @bean
s them.
this works fine service objects themselves, can't find way load service interface in java without @integrationcomponentscan
. current workaround include "one-liner" xml file <int-gateway>
tag , @importresource
it, i'd prefer more direct solution.
is there straightforward way in javaconfig tell spring integration create proxy service interface specific class?
gatewayproxyfactorybean
you. class used populate bean definition <int:gateway>
tag , messaginggateway
annotation.
so, can this:
@bean public gatewayproxyfactorybean mygateway() { gatewayproxyfactorybean factorybean = new gatewayproxyfactorybean(yourserviceinterface.class); factorybean.setdefaultrequestchannel(gatewayrequestchannel()); homecoming factorybean; }
spring spring-integration spring-java-config
Comments
Post a Comment