Really just trying to make sure I understand how the configuration works.  If
I auto configure activemq with Spring Boot, I have noticed that an activemq
component is also created in the camel context.  Is Spring Boot creating
this component or the camel context?

So when I need to have a component configured differently, should I make the
configuration changes on the endpoint or just create a different component?

Are there really any differences between these two configurations?

-----------------------------------
create new component to handle transaction.
   @Bean
    public ActiveMQComponent activemqtx(PooledConnectionFactory
pooledConnectionFactory) {
        ActiveMQComponent activeMQComponent = new ActiveMQComponent();
        activeMQComponent.setTransacted(true);
        activeMQComponent.setTransactionManager(new
JmsTransactionManager(pooledConnectionFactory));
        return activeMQComponent;
    }

   from("activemq:TRIGGER").routeId("Trigger")
                .onException(Exception.class)
                    .maximumRedeliveries(2)
                    .to("activemq:EXCEPTION")
                    .markRollbackOnlyLast().end()
                .transacted()
                .bean("jpaRepository")
                .to("log:out");

Or just configure the enpoint.

   from("activemq:TRIGGER?transacted=true").routeId("Trigger")
                .onException(Exception.class)
                    .maximumRedeliveries(7)
                    .to("activemq:EXCEPTION")
                    .markRollbackOnlyLast().end()
                .transacted()
                .bean("jpaRepository")
                .to("log:out");


I'm guessing that creating a component allows for better reuse if you have
several routes using the same configuration.

Sample code I have been testing with
https://github.com/zachariahyoung/docker-camel




--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-and-Activemq-setup-with-Spring-Boot-tp5774544p5774728.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to