You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by Jakki <ja...@gmail.com> on 2016/12/16 17:58:19 UTC

Moving message from one queue to another using Apache.NMS.ActiveMQ;

I am new to ActiveMQ, I am trying create an application in C#.net.  Could you
please help me in moving a message from 1 queue to another queue in Active
MQ?



--
View this message in context: http://activemq.2283324.n4.nabble.com/Moving-message-from-one-queue-to-another-using-Apache-NMS-ActiveMQ-tp4720534.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Re: Moving message from one queue to another using Apache.NMS.ActiveMQ;

Posted by Jim Gomes <jg...@apache.org>.
Hi Jakki,

Here's a little snippet that should get you started:

IConnectionFactory factory =
NMSConnectionFactory.CreateConnectionFactory("activemq:failover:tcp://activemqhost:61616");

using(IConnection connection = factory.CreateConnection())
using(ISession session =
connection.CreateSession(AcknowledgementMode.AutoAcknowledge))
{
IDestination srcQueue = session.GetDestination("queue://Source");
IDestination destQueue = session.GetDestination("queue://Destination");
IMessageConsumer consumer = session.CreateConsumer(srcQueue);
IMessageProducer producer = session.CreateProducer(destQueue);

connection.Start();
// Copy message from source queue to destination queue.
producer.Send(consumer.Receive());
}

Looking at the source code to the unit tests can be very informative, too.

Best,
Jim

On Fri, Dec 16, 2016 at 11:24 AM Jakki <ja...@gmail.com> wrote:

> I am new to ActiveMQ, I am trying create an application in C#.net.  Could
> you
> please help me in moving a message from 1 queue to another queue in Active
> MQ?
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Moving-message-from-one-queue-to-another-using-Apache-NMS-ActiveMQ-tp4720534.html
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>

Re: Moving message from one queue to another using Apache.NMS.ActiveMQ;

Posted by Hassen Bennour <be...@gmail.com>.
http://activemq.apache.org/sample-camel-routes.html
Le 16 déc. 2016 21:10, "Hassen Bennour" <be...@gmail.com> a écrit :

> By consuming from one and producing to second one but in broker side you
> can use camel routes or composite destinations interceptors like this
>
> <destinationInterceptors>
>   <virtualDestinationInterceptor>
>     <virtualDestinations>
>       <compositeQueue name="MY.QUEUE">
>         <forwardTo>
>           <queue physicalName="FOO" />
>           <topic physicalName="BAR" />
>         </forwardTo>
>       </compositeQueue>
>     </virtualDestinations>
>   </virtualDestinationInterceptor>
> </destinationInterceptors>
>
> http://activemq.apache.org/virtual-destinations.html
> Le 16 déc. 2016 20:24, "Jakki" <ja...@gmail.com> a écrit :
>
>> I am new to ActiveMQ, I am trying create an application in C#.net.  Could
>> you
>> please help me in moving a message from 1 queue to another queue in Active
>> MQ?
>>
>>
>>
>> --
>> View this message in context: http://activemq.2283324.n4.nab
>> ble.com/Moving-message-from-one-queue-to-another-using-
>> Apache-NMS-ActiveMQ-tp4720534.html
>> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>>
>

Re: Moving message from one queue to another using Apache.NMS.ActiveMQ;

Posted by Hassen Bennour <be...@gmail.com>.
By consuming from one and producing to second one but in broker side you
can use camel routes or composite destinations interceptors like this

<destinationInterceptors>
  <virtualDestinationInterceptor>
    <virtualDestinations>
      <compositeQueue name="MY.QUEUE">
        <forwardTo>
          <queue physicalName="FOO" />
          <topic physicalName="BAR" />
        </forwardTo>
      </compositeQueue>
    </virtualDestinations>
  </virtualDestinationInterceptor>
</destinationInterceptors>

http://activemq.apache.org/virtual-destinations.html
Le 16 déc. 2016 20:24, "Jakki" <ja...@gmail.com> a écrit :

> I am new to ActiveMQ, I am trying create an application in C#.net.  Could
> you
> please help me in moving a message from 1 queue to another queue in Active
> MQ?
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/Moving-message-from-one-queue-to-another-
> using-Apache-NMS-ActiveMQ-tp4720534.html
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>