You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Scott <li...@hotmail.com> on 2011/06/15 05:51:31 UTC

How to reprocess DLQ message in .NET C#?

According to
http://activemq.2283324.n4.nabble.com/Programmatically-reprocessing-messages-from-a-dead-letter-queue-td2361418.html

We can use "QueueViewMBean" to reprocess messages in dead letter queue. But
I can't find this class in NMS. 
Is there a way we can reprocess DLQ message use C# code?


Thank you in advanced.

--
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-reprocess-DLQ-message-in-NET-C-tp3598457p3598457.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How to reprocess DLQ message in .NET C#?

Posted by Timothy Bish <ta...@gmail.com>.
On Thu, 2011-06-16 at 10:21 -0700, Scott wrote:
> Hi Tim, how can i republish the message using standard NMS APIs?
> 
> Is there any NMS API can move message from DLQ to Original Destination
> instead of creating a new message?
> 
> The following code is i use to reply message from DLQ, but it always create
> a new message instead of using old message.
> 
> IMessageConsumer consumer = session.CreateConsumer( new
> Apache.NMS.ActiveMQ.Commands.ActiveMQQueue("ActiveMQ.DLQ"));
> IMessageProducer producer =
> session.CreateProducer(((ActiveMQMessage)message).OriginalDestination);
> producer.Send(message);

That's really the only option from a .NET client using NMS point of
view.  I guess you could use something like IKVM to allow you client to
interact via JMX.  

Regards

-- 
Tim Bish
------------
FuseSource
Email: tim.bish@fusesource.com
Web: http://fusesource.com
Twitter: tabish121
Blog: http://timbish.blogspot.com/




Re: How to reprocess DLQ message in .NET C#?

Posted by Scott <li...@hotmail.com>.
Hi Tim, how can i republish the message using standard NMS APIs?

Is there any NMS API can move message from DLQ to Original Destination
instead of creating a new message?

The following code is i use to reply message from DLQ, but it always create
a new message instead of using old message.

IMessageConsumer consumer = session.CreateConsumer( new
Apache.NMS.ActiveMQ.Commands.ActiveMQQueue("ActiveMQ.DLQ"));
IMessageProducer producer =
session.CreateProducer(((ActiveMQMessage)message).OriginalDestination);
producer.Send(message);

--
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-reprocess-DLQ-message-in-NET-C-tp3598457p3603105.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How to reprocess DLQ message in .NET C#?

Posted by Timothy Bish <ta...@gmail.com>.
On Tue, 2011-06-14 at 20:51 -0700, Scott wrote:
> According to
> http://activemq.2283324.n4.nabble.com/Programmatically-reprocessing-messages-from-a-dead-letter-queue-td2361418.html
> 
> We can use "QueueViewMBean" to reprocess messages in dead letter queue. But
> I can't find this class in NMS. 
> Is there a way we can reprocess DLQ message use C# code?
> 
> 
> Thank you in advanced.

That thread is referring to the MBeans that are part of the JMX
management API of the broker.  You can't access the JMX bits from NMS.
You could create a consumer for the DLQ and republish the message as you
see fit though using standard NMS APIs.

Regards


-- 
Tim Bish
------------
FuseSource
Email: tim.bish@fusesource.com
Web: http://fusesource.com
Twitter: tabish121
Blog: http://timbish.blogspot.com/