camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joakim Bjørnstad <joak...@gmail.com>
Subject Re: Camel and Activemq setup with Spring Boot
Date Fri, 04 Dec 2015 09:00:29 GMT
Hello,

I'd check out the source of JmsAutoConfiguration and
ActiveMQAutoConfiguration to see what Spring Boot autoconfigures.
Essentially everything under the
org.springframework.boot.autoconfigure package.

For example ActiveMQ can be configured by supplying ActiveMQProperties
through Spring Boot externalized configuration.
spring.activemq.brokerUrl
spring.activemq.inMemory
spring.activemq.pooled
spring.activemq.user
spring.activemq.password

So you can probably cut a bean or two if you go that way. Also IMO not
necessary to explicitly add components to the camel context. Register
a Component bean in Spring and you can refer to it by methodname in
the camel URI. It gets automatically registered.

e.g.:

@Bean
@Inject
public JmsComponent myjms(ConnectionFactory myConnectionFactory) {
  JmsComponent jmsComponent = new JmsComponent();
  jmsComponent.setConnectionFactory(myConnectionFactory);
  return jmsComponent;
}

The component should automatically be available in Camel (same should
go for ActiveMQComponent): myjms:MY_QUEUE?concurrentConsumers=10

But what is the issue really, just clean up Spring config or is there
something not working with your config ?


On Fri, Dec 4, 2015 at 5:12 AM, zpyoung <zpyoung@gmail.com> wrote:
> Any help on this?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-and-Activemq-setup-with-Spring-Boot-tp5774544p5774651.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Kind regards
Joakim Bjørnstad

Mime
View raw message