You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by jerdavis <je...@speakeasy.net> on 2010/02/25 21:12:58 UTC

Need Help Using Native Java API


I need a little help with the Native Java API.
I chose not to use JMS because I'm trying to accomplish a specific messaging
pattern that doesn't work in JMS:

I would like to read from a queue, and not ACK the messages until a later
time, and I don't want to have to individually ack each message at the end.
Should my app crash or otherwise signal the Broker before the ACK, it may
also ask the broker to redeliver all the messages.

So for example.. Read 1 million messages, and on the 1 millionth, send one
ack, and the Broker deletes all 1M from the Queue.
However if during processing the 500,000th message my application throws an
exception, I would signal the broker to start over from Msg #1.

Would this sort of thing be possible?

I was able to implement this on rabbitMQ with AMQP0-8 by:
channel.basicGet(NO_ACK)
then
channel.basicAck( DeliveryTag(a long) from the Millionth Msg,
true(ACK_MULTIPLE) )

Many thanks!
-- 
View this message in context: http://n2.nabble.com/Need-Help-Using-Native-Java-API-tp4635059p4635059.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Need Help Using Native Java API

Posted by jerdavis <je...@speakeasy.net>.
Thankyou.
-- 
View this message in context: http://n2.nabble.com/Need-Help-Using-Native-Java-API-tp4635059p4635887.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Need Help Using Native Java API

Posted by Rajith Attapattu <ra...@gmail.com>.
On Thu, Feb 25, 2010 at 3:12 PM, jerdavis <je...@speakeasy.net> wrote:
>
>
> I need a little help with the Native Java API.
> I chose not to use JMS because I'm trying to accomplish a specific messaging
> pattern that doesn't work in JMS:

There is no supported Native Java API.
The use case you described below can be done with JMS.

You need to use CLIENT_ACK as the acknowledge mode when creating the session.
Then when you ack the millionth message, all the messages will be acked.

> I would like to read from a queue, and not ACK the messages until a later
> time, and I don't want to have to individually ack each message at the end.
> Should my app crash or otherwise signal the Broker before the ACK, it may
> also ask the broker to redeliver all the messages.
>
> So for example.. Read 1 million messages, and on the 1 millionth, send one
> ack, and the Broker deletes all 1M from the Queue.
> However if during processing the 500,000th message my application throws an
> exception, I would signal the broker to start over from Msg #1.
>
> Would this sort of thing be possible?
>
> I was able to implement this on rabbitMQ with AMQP0-8 by:
> channel.basicGet(NO_ACK)
> then
> channel.basicAck( DeliveryTag(a long) from the Millionth Msg,
> true(ACK_MULTIPLE) )
>
> Many thanks!
> --
> View this message in context: http://n2.nabble.com/Need-Help-Using-Native-Java-API-tp4635059p4635059.html
> Sent from the Apache Qpid users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
>



-- 
Regards,

Rajith Attapattu
Red Hat
http://rajith.2rlabs.com/

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Need Help Using Native Java API

Posted by jerdavis <je...@speakeasy.net>.

I see public void acknowledgeMessage(long deliveryTag, boolean multiple) in
AMQSession_0_10.java... I'm optimistic someone will be able to point me in
the right direction.



-- 
View this message in context: http://n2.nabble.com/Need-Help-Using-Native-Java-API-tp4635059p4635706.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org