[prev in list] [next in list] [prev in thread] [next in thread]
List: activemq-dev
Subject: Re: Moving message from one queue to another using Apache.NMS.ActiveMQ;
From: Jim Gomes <jgomes () apache ! org>
Date: 2016-12-17 23:31:45
Message-ID: CAGeZ+bhsTNyS8QswQ6xCznMdh3A=MkZKEADtTvUb_rLCKkqpCg () mail ! gmail ! com
[Download RAW message or body]
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 <jakkisri84@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.
>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic