Re-ordering of messages - Artemis

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Re-ordering of messages - Artemis

alisu
In my use case, I have to run two instances of the same application that read
messages from 'queue-1' and write them back to another queue 'queue-2'.  I
need my messages inside the two queues to be ordered by specific property
(sequence number) which is initially added to every message by producer. As
per documentation, inside queue-1 the order of messages will be preserved as
messages are sent by a single producer. But because of having multiple
consumers that read, process and send the processed messages to queue-2, the
order of messages inside queue-2 might be lost. So my task is to make sure
that messages are delivered to queue-2 in the same order as they were read
from queue-1. I have implemented re-sequencer pattern from Apache camel to
re-order messages inside queue-2. The re-sequencer works fine but results to
data transfer overhead as the camel routes run locally. Thinking about doing
it in a better way, I have three questions:

1) Does artemis supports re-ordering of messages inside a queue using a
property such as sequence number.

2) Is it possible to run the routes inside the server? If yes, can you give
an example or give a link to the documentation?

3) Some artemis features such as divert (split) requires modifying broker
configuration (broker.xml file), is there a way to do them programatically
and dynamically so I can decide when to start diverting message? I know this
can be accomplished by using camel, but I want everything to be running in
the server.

Thanks.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
Reply | Threaded
Open this post in threaded view
|

Re: Re-ordering of messages - Artemis

Justin Bertram
I responded to your same post over on Stackoverflow [1].

In order to avoid confusion it might be best not to post the same question
in multiple places.


Justin

[1]
https://stackoverflow.com/questions/47333287/re-ordering-of-messages-artemis

On Thu, Nov 16, 2017 at 6:34 AM, alisu <[hidden email]> wrote:

> In my use case, I have to run two instances of the same application that
> read
> messages from 'queue-1' and write them back to another queue 'queue-2'.  I
> need my messages inside the two queues to be ordered by specific property
> (sequence number) which is initially added to every message by producer. As
> per documentation, inside queue-1 the order of messages will be preserved
> as
> messages are sent by a single producer. But because of having multiple
> consumers that read, process and send the processed messages to queue-2,
> the
> order of messages inside queue-2 might be lost. So my task is to make sure
> that messages are delivered to queue-2 in the same order as they were read
> from queue-1. I have implemented re-sequencer pattern from Apache camel to
> re-order messages inside queue-2. The re-sequencer works fine but results
> to
> data transfer overhead as the camel routes run locally. Thinking about
> doing
> it in a better way, I have three questions:
>
> 1) Does artemis supports re-ordering of messages inside a queue using a
> property such as sequence number.
>
> 2) Is it possible to run the routes inside the server? If yes, can you give
> an example or give a link to the documentation?
>
> 3) Some artemis features such as divert (split) requires modifying broker
> configuration (broker.xml file), is there a way to do them programatically
> and dynamically so I can decide when to start diverting message? I know
> this
> can be accomplished by using camel, but I want everything to be running in
> the server.
>
> Thanks.
>
>
>
> --
> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-
> f2341805.html
>
Reply | Threaded
Open this post in threaded view
|

Re: Re-ordering of messages - Artemis

gtully
It is interesting... the entire index is in memory, and I noticed a jmx
operation that will swap the priority of a message, it just means moving it
between priority lists in the in memory index[1].
Ordering would be more expensive by far, but by replacing the priority
lists with some sort of ordered list could work. It would be an application
specific queue rather than a generic FIFI queue.
I wonder if it would make sense to have the list impl plugable[2] for an
address. In that way there could be an application specific comparator. It
would sort this use case in the most optimal way.

[1]
https://github.com/apache/activemq-artemis/blob/b7125d51c318175e1a78b4162aeb0cf24ec18a15/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java#L1889

[2]
https://github.com/apache/activemq-artemis/blob/b7125d51c318175e1a78b4162aeb0cf24ec18a15/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java#L165

On Thu, 16 Nov 2017 at 17:20 Justin Bertram <[hidden email]> wrote:

> I responded to your same post over on Stackoverflow [1].
>
> In order to avoid confusion it might be best not to post the same question
> in multiple places.
>
>
> Justin
>
> [1]
>
> https://stackoverflow.com/questions/47333287/re-ordering-of-messages-artemis
>
> On Thu, Nov 16, 2017 at 6:34 AM, alisu <[hidden email]> wrote:
>
> > In my use case, I have to run two instances of the same application that
> > read
> > messages from 'queue-1' and write them back to another queue 'queue-2'.
> I
> > need my messages inside the two queues to be ordered by specific property
> > (sequence number) which is initially added to every message by producer.
> As
> > per documentation, inside queue-1 the order of messages will be preserved
> > as
> > messages are sent by a single producer. But because of having multiple
> > consumers that read, process and send the processed messages to queue-2,
> > the
> > order of messages inside queue-2 might be lost. So my task is to make
> sure
> > that messages are delivered to queue-2 in the same order as they were
> read
> > from queue-1. I have implemented re-sequencer pattern from Apache camel
> to
> > re-order messages inside queue-2. The re-sequencer works fine but results
> > to
> > data transfer overhead as the camel routes run locally. Thinking about
> > doing
> > it in a better way, I have three questions:
> >
> > 1) Does artemis supports re-ordering of messages inside a queue using a
> > property such as sequence number.
> >
> > 2) Is it possible to run the routes inside the server? If yes, can you
> give
> > an example or give a link to the documentation?
> >
> > 3) Some artemis features such as divert (split) requires modifying broker
> > configuration (broker.xml file), is there a way to do them
> programatically
> > and dynamically so I can decide when to start diverting message? I know
> > this
> > can be accomplished by using camel, but I want everything to be running
> in
> > the server.
> >
> > Thanks.
> >
> >
> >
> > --
> > Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-
> > f2341805.html
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Re-ordering of messages - Artemis

alisu
Thanks Justin and gtully for your responses. As Justin said, it is possible t
run camel routes inside the broker, now I have been experimenting with this.
First, I have tried this with ActiveMQ 5.15.1 as described in [1], and
everything works fine. But when I do the same thing with Artemis, by adding
/*<import resource="camel.xml"/>*/ inside broker.xml or bootstrap.xml file ,
the server doesn't start up instead I get the following exception:

/Exception in thread "main" javax.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException; lineNumber: 35; columnNumber: 32;
cvc-complex-type.2.4.a: Invalid content was found starting with element
'import'. One of '{"http://activemq.org/schema":component,
"http://activemq.org/schema":web}' is expected.]
        at
com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:468)
        at
com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:402)
        at
com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:371)
        at org.apache.activemq.artemis.dto.XmlUtil.decode(XmlUtil.java:117)
        at
org.apache.activemq.artemis.cli.factory.xml.XmlBrokerFactoryHandler.createBroker(XmlBrokerFactoryHandler.java:35)
        at
org.apache.activemq.artemis.cli.factory.BrokerFactory.createBrokerConfiguration(BrokerFactory.java:46)
        at
org.apache.activemq.artemis.cli.factory.BrokerFactory.createBrokerConfiguration(BrokerFactory.java:53)
        at
org.apache.activemq.artemis.cli.commands.Configurable.getBrokerDTO(Configurable.java:105)
        at org.apache.activemq.artemis.cli.commands.Run.execute(Run.java:65)
        at
org.apache.activemq.artemis.cli.Artemis.internalExecute(Artemis.java:149)
        at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:96)
        at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:123)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.activemq.artemis.boot.Artemis.execute(Artemis.java:129)/

Where am I getting wrong?

[1]
https://github.com/apache/activemq/blob/57795bafcea290c6879bb288822435c480a9212d/assembly/src/release/examples/conf/camel.xml
<https://github.com/apache/activemq/blob/57795bafcea290c6879bb288822435c480a9212d/assembly/src/release/examples/conf/camel.xml>  



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
Reply | Threaded
Open this post in threaded view
|

Re: Re-ordering of messages - Artemis

jbertram
> Where am I getting wrong?

The fact that you're attempting to modify broker.xml and/or bootstap.xml
indicates to me that you didn't understand my comment on Stackoverflow.  I
specifically noted that you need to use "a web application with a Camel
context," and linked to some documentation on that for 5.x that should help
you put together the web-application.  Can you try this approach?


Justin

On Mon, Nov 20, 2017 at 6:49 AM, alisu <[hidden email]> wrote:

> Thanks Justin and gtully for your responses. As Justin said, it is
> possible t
> run camel routes inside the broker, now I have been experimenting with
> this.
> First, I have tried this with ActiveMQ 5.15.1 as described in [1], and
> everything works fine. But when I do the same thing with Artemis, by adding
> /*<import resource="camel.xml"/>*/ inside broker.xml or bootstrap.xml file
> ,
> the server doesn't start up instead I get the following exception:
>
> /Exception in thread "main" javax.xml.bind.UnmarshalException
>  - with linked exception:
> [org.xml.sax.SAXParseException; lineNumber: 35; columnNumber: 32;
> cvc-complex-type.2.4.a: Invalid content was found starting with element
> 'import'. One of '{"http://activemq.org/schema":component,
> "http://activemq.org/schema":web}' is expected.]
>         at
> com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.
> handleStreamException(UnmarshallerImpl.java:468)
>         at
> com.sun.xml.internal.bind.v2.runtime.unmarshaller.
> UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:402)
>         at
> com.sun.xml.internal.bind.v2.runtime.unmarshaller.
> UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:371)
>         at org.apache.activemq.artemis.dto.XmlUtil.decode(XmlUtil.
> java:117)
>         at
> org.apache.activemq.artemis.cli.factory.xml.XmlBrokerFactoryHandler.
> createBroker(XmlBrokerFactoryHandler.java:35)
>         at
> org.apache.activemq.artemis.cli.factory.BrokerFactory.
> createBrokerConfiguration(BrokerFactory.java:46)
>         at
> org.apache.activemq.artemis.cli.factory.BrokerFactory.
> createBrokerConfiguration(BrokerFactory.java:53)
>         at
> org.apache.activemq.artemis.cli.commands.Configurable.
> getBrokerDTO(Configurable.java:105)
>         at org.apache.activemq.artemis.cli.commands.Run.execute(Run.
> java:65)
>         at
> org.apache.activemq.artemis.cli.Artemis.internalExecute(Artemis.java:149)
>         at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.
> java:96)
>         at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.
> java:123)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> 62)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:498)
>         at org.apache.activemq.artemis.boot.Artemis.execute(Artemis.
> java:129)/
>
> Where am I getting wrong?
>
> [1]
> https://github.com/apache/activemq/blob/57795bafcea290c6879bb288822435
> c480a9212d/assembly/src/release/examples/conf/camel.xml
> <https://github.com/apache/activemq/blob/57795bafcea290c6879bb288822435
> c480a9212d/assembly/src/release/examples/conf/camel.xml>
>
>
>
> --
> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-
> f2341805.html
>
Reply | Threaded
Open this post in threaded view
|

Re: Re-ordering of messages - Artemis

alisu
Hi Justin,
My thought was, just like ActiveMQ, this could simply be done without the
need to integrate spring into the the server. I have created a web
application as per the link you pointed to, and add the following details
inside web.xml and applicationContext.xml files.

*web.xml*
/<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID"
version="3.0">
  <display-name>artemis-camel</display-name>
  <listener>
   
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
</web-app>/

*applicationContext.xml*
/<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
        xsi:schemaLocation="
       http://www.springframework.org/schema/beans 
       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
       http://www.springframework.org/schema/context 
       http://www.springframework.org/schema/context/spring-context-2.5.xsd
       http://camel.apache.org/schema/spring 
       http://camel.apache.org/schema/spring/camel-spring.xsd">

       
        <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
                <route>
                        <description>Example Camel Route</description>
                        <from uri="artemis:example.A" />
                        <to uri="artemis:example.B" />
                </route>
        </camelContext>

        <bean id="artemis" class="org.apache.camel.component.jms.JmsComponent">
                <property name="connectionFactory">
                        <bean class="org.apache.activemq.ActiveMQConnectionFactory">
                                <property name="brokerURL" value="tcp://localhost:61616" />
                                <property name="userName" value="${activemq.username}" />
                                <property name="password" value="${activemq.password}" />
                        </bean>
                </property>
        </bean>
</beans>/

And in my pom.xml, I only have the following dependencies:

/<dependencies>
                <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-web</artifactId>
                        <version>3.0.5.RELEASE</version>
                </dependency>
                <dependency>
                        <groupId>org.apache.camel</groupId>
                        <artifactId>camel-spring</artifactId>
                        <version>2.13.2</version>
                </dependency>
                <dependency>
                        <groupId>org.apache.activemq</groupId>
                        <artifactId>activemq-camel</artifactId>
                        <version>5.15.1</version>
                </dependency>
</dependencies>/

But when I run the application, I get the following exception:

/
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected
exception parsing XML document from ServletContext resource
[/WEB-INF/applicationContext.xml]; nested exception is
java.lang.NoSuchFieldError: REFLECTION
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
        at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
        at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
        at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
        at
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
        at
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)
        at
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
        at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
        at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
        at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
        at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
        at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
        at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5110)
        at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5633)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
        at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1700)
        at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1690)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoSuchFieldError: REFLECTION
        at
com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.<init>(RuntimeModelBuilder.java:93)
        at
com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:455)
        at
com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:303)
        at
com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:142)
        at
com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1174)
        at
com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:162)
        at
com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:286)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:171)
        at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:131)
        at javax.xml.bind.ContextFinder.find(ContextFinder.java:335)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:431)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:394)
        at
org.apache.camel.spring.handler.CamelNamespaceHandler.createJaxbContext(CamelNamespaceHandler.java:188)
        at
org.apache.camel.spring.handler.CamelNamespaceHandler.getJaxbContext(CamelNamespaceHandler.java:175)
        at
org.apache.camel.spring.handler.CamelNamespaceHandler$CamelContextBeanDefinitionParser.doParse(CamelNamespaceHandler.java:303)
        at
org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser.parseInternal(AbstractSingleBeanDefinitionParser.java:85)
        at
org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parse(AbstractBeanDefinitionParser.java:59)
        at
org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73)
        at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1335)
        at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1325)
        at
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
        at
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
        ... 22 more/

Most of the online solutions to the problem mention about dependency
conflicts and use of non-compatible versions between camel and other
libraries such as CFX or JAXB. Am I being faced with the same problem? I am
not using either of this libraries.

Alisu



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
Reply | Threaded
Open this post in threaded view
|

Re: Re-ordering of messages - Artemis

alisu
I have managed to sort out the dependency conflict problem. Actually both
camel-spring and activemq-camel come with jaxb. So I just made sure they
both use the same version of jaxb. e.g. by using activemq-camel-5.15.1 and
camel-spring-2.20.1 where they both use jaxb-2.2.11.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
Reply | Threaded
Open this post in threaded view
|

Re: Re-ordering of messages - Artemis

jbertram
There really shouldn't be any reason to use the activemq-camel dependency.
Here's an example pom.xml that I've used to build a web-app with a Camel
context:

<?xml version='1.0'?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>

   <artifactId>camelwar</artifactId>
   <packaging>war</packaging>
   <name>ActiveMQ Artemis Camel WAR Example</name>

   <dependencies>
      <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-web</artifactId>
         <version>${spring.version}</version>
      </dependency>
      <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-context</artifactId>
      </dependency>
      <dependency>
         <groupId>org.apache.camel</groupId>
         <artifactId>camel-spring</artifactId>
         <version>2.20.0</version>
         <exclusions>
            <exclusion>
               <groupId>org.slf4j</groupId>
               <artifactId>slf4j-api</artifactId>
            </exclusion>
         </exclusions>
      </dependency>
      <dependency>
         <groupId>org.apache.camel</groupId>
         <artifactId>camel-jms</artifactId>
         <version>2.20.0</version>
         <exclusions>
            <exclusion>
               <groupId>org.slf4j</groupId>
               <artifactId>slf4j-api</artifactId>
            </exclusion>
            <exclusion>
               <groupId>org.apache.geronimo.specs</groupId>
               <artifactId>geronimo-jms_2.0_spec</artifactId>
            </exclusion>
         </exclusions>
      </dependency>
   </dependencies>
</project>

This pom should include everything you need and filter out everything
that's already provided by the broker so there are no conflicts.

And here's the applicationContext.xml:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
       http://www.springframework.org/schema/context
       http://www.springframework.org/schema/context/spring-context-2.5.xsd
       http://camel.apache.org/schema/spring
       http://camel.apache.org/schema/spring/camel-spring.xsd">

   <bean id="artemisConnectionFactory"
class="org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory">
      <constructor-arg name="url" value="tcp://localhost:61616"/>
   </bean>

   <bean id="artemisConfig"
class="org.apache.camel.component.jms.JmsConfiguration">
      <property name="connectionFactory" ref="artemisConnectionFactory"/>
      <property name="concurrentConsumers" value="10"/>
   </bean>

   <bean id="artemis" class="org.apache.camel.component.jms.JmsComponent">
      <property name="configuration" ref="artemisConfig"/>
   </bean>

   <camelContext id="bridgeContext" trace="false" xmlns="
http://camel.apache.org/schema/spring">
      <route id="exampleRoute">
         <from uri="artemis:queue:sausage-factory"/>
         <to uri="artemis:queue:mincing-machine"/>
      </route>
   </camelContext>
</beans>


Justin



On Tue, Nov 21, 2017 at 6:45 AM, alisu <[hidden email]> wrote:

> I have managed to sort out the dependency conflict problem. Actually both
> camel-spring and activemq-camel come with jaxb. So I just made sure they
> both use the same version of jaxb. e.g. by using activemq-camel-5.15.1 and
> camel-spring-2.20.1 where they both use jaxb-2.2.11.
>
>
>
> --
> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-
> f2341805.html
>
Reply | Threaded
Open this post in threaded view
|

Re: Re-ordering of messages - Artemis

alisu
Thanks Justin, got my routes now running inside Artemis server.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html