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/07/10 12:14:15 UTC

Two conceptual questions in producer and consumer

Hi,

I am going to set acknowledge.Transactional for my message, but i am a bit
confuse on where to set.
Is it in producer or consumer? what is the different? 

And how about redeliver policy? where should i set? producer or consumer?
what is the different?

Can someone help me clear these two conceptual questions?  

Thank you in advanced.

--
View this message in context: http://activemq.2283324.n4.nabble.com/Two-conceptual-questions-in-producer-and-consumer-tp3657421p3657421.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Two conceptual questions in producer and consumer

Posted by Scott <li...@hotmail.com>.
>Not sure what exactly you mean here. Do you intend to use a 
>transactional JMS session? You can configure 
>a transaction between your producer and your broker as well as between 
>the broker and your consumer.

What i am going to ask is any different between transaction in
producer,broker and that in broker, consumer.

For example:
Background:
1. transaction between producer and broker
2. Auto acknowledge between broker and consumer

Scenario:
i send transaction A (with 10 messages) from producer to broker, how broker
send to consumer? Does it consider these 10 messages as one transaction or
10 messages or 1 message? if any of these 10 messages fail during broker to
consumer, will it rollback all 10 message?



--
View this message in context: http://activemq.2283324.n4.nabble.com/Two-conceptual-questions-in-producer-and-consumer-tp3657421p3659960.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Two conceptual questions in producer and consumer

Posted by Torsten Mielke <to...@fusesource.com>.
Regarding redelivery have a read over 
http://activemq.apache.org/redelivery-policy.html, and
http://activemq.apache.org/message-redelivery-and-dlq-handling.html

In short, the redelivery policy is configured on the
ActiveMQConnectionFactory inside your consumer process.

> I am going to set acknowledge.Transactional for my message, 
> but i am a bit confuse on where to set.

Not sure what exactly you mean here. Do you intend to use a
transactional JMS session? You can configure
a transaction between your producer and your broker as well as between
the broker and your consumer.
When creating your JMS session, you can define whether its transactional
or not.
See the javadoc of javax.jms.Connection, it exposes the method

public Session createSession(boolean transacted, int acknowledgeMode)

Hope this helps.


-- 
Torsten Mielke
FuseSource
tmielke.blogspot.com