[rabbitmq-discuss] Persistence and Transactions
watson.timothy at gmail.com
Thu Dec 27 10:21:17 GMT 2012
On 27 Dec 2012, at 00:45, CJ <rmqjava1a at yahoo.com> wrote:
> From the examples I have seen, on the Publish side
> 1> You place a PERSISTENT_TEXT_PLAIN in the basicPublish call to perform
Correct - this is a message property that sets deliveryMode = 2 which is what actually marks the message as persistent.
> 2> You use a channel.txSelect and a channel.txCommit to perform
> However, from the examples I have seen, there is no such requirement on the
> consumer side
> 1> Do I have to perform any special coding for a consumption of a
> persistent message.
No none at all.
> 2> Do I have to use a txCommit to perform a transaction of the ACKNOLEDGE on
> a consumer (I understand that the consumption is not under a tx basis).
Not sure I understand the question here. If there is no transaction running then ACKs will just work and you don't need to do anything apart form sending them.
If your consumer starts a transaction o a channel then the opposite is true. Consumer and producer transactions are completely separate. You cannot have a transaction that spans both clients. If a client is running in a transaction then ACKs it sends will be held uncommitted until the transaction commits. Or if the transaction rolls back, the client can still send the ACK afterwards, outside the transaction context wherein it will be treated like any other non-transactional ack. This is orthogonal to message persistence.
> View this message in context: http://rabbitmq.1065348.n5.nabble.com/Persistence-and-Transactions-tp24204.html
> Sent from the RabbitMQ mailing list archive at Nabble.com.
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
More information about the rabbitmq-discuss