qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Godfrey <rob.j.godf...@gmail.com>
Subject Re: Broker-J Queue Message persistent override
Date Thu, 22 Mar 2018 09:24:52 GMT
Getting back to the original question - do we have any evidence that the
messages are actually being stored persistently, or is it just that fact
that the messages say "persistent=true" when viewed through the API?

As per my earlier replies, I believe that if the message is sent only to
queues which are non-durable, or that have their messageDurability set to
NEVER then the message will not actually be persistently stored (though
other than observing the size of store files on disk it may be difficult to
determine this).

-- Rob

On 21 March 2018 at 22:55, Keith W <keith.wall@gmail.com> wrote:

> Hi Bryan
>
> You are modifying the correct attribute on the queue.   At the API
> level it is called Queue#messageDurability.  Within the Queue UI it is
> labelled "Persist Messages". There is no good reason for the
> inconsistency in terminology here. My apologies for any confusion.
>
> From your description on the behaviour, the feature is working
> correctly.   The feature tells the queue to override the sender's
> message persistence wishes: ALWAYS will cause the queue to consider
> the message to be handled as if it were persistent, NEVER as if it
> were not persistent.  DEFAULT respects the sender's original
> persistence wish.  The feature influences the queue's storage
> behaviour. It does not cause the message's header to be rewritten.
> The message's header conveys the sender's delivery instructions and is
> mostly* considered immutable by the Broker.  After all, the Broker
> might be just one of many intermediaries, and just because you wish
> one Broker to countermand the persistence setting, does not mean you
> want the same to apply to all intermediaries that follow. So the fact
> that delivered message header does not reflect the overrides
> persistence is expected.  Management just offers a view onto the
> message header so again, it shows what the sender sent.
>
> * different versions of AMQP have different rules.
>
> Hope this helps.
>
>
>
> The feature overrides the message's persistence setting to true if set
> ALWAYS, and false if set NEVER.  If set DEFAULT, the sender's original
> persistence wishes are respected.
>
> On 21 March 2018 at 16:51, Bryan Dixon <bryan@bldixon.net> wrote:
> > Alex your response about queue attribute 'messageDurability' isn't what
> I had
> > set to NEVER - it was the Persist Messages? attribute that I set to
> NEVER.
> > I want to make sure I'm on the same page as you guys and I'll provide
> some
> > screen shots to show what I did and saw.
> >
> > Firstly, my original post was referring to the attribute 'Message
> persistent
> > override' from this documentation:
> > https://qpid.apache.org/releases/qpid-broker-j-7.0.2/
> book/Java-Broker-Management-Managing-Queues.html.
> >
> > There is a 'Durable' attribute documented on that page also and my
> current
> > setting is enabled (checked on the admin UI) but that wasn't what I
> wanting
> > to change/test.
> >
> > Using the web admin UI I changed a queue's Persist Messages? value to
> NEVER
> > - see this screen shot
> > <http://qpid.2158936.n2.nabble.com/file/t396334/
> broker-j-queue-persist.png>
> >
> > I then ran this Java code using Qpid JMS 0.30.0 jars:
> > ConnectionFactory connectionFactory = new JmsConnectionFactory(
> brokerUrl);
> > Connection connection = connectionFactory.createConnection(user, pwd);
> > Session session = connection.createSession(false,
> Session.AUTO_ACKNOWLEDGE);
> > Destination destination =
> > session.createQueue("app_attach_ehcacheReplicateQueue");
> > MessageProducer messageProducer = session.createProducer(destination);
> > TextMessage message = session.createTextMessage("Hello world! " + new
> > Timestamp(System.currentTimeMillis()));
> > messageProducer.send(message);
> >
> > It published the message to the queue and when I view the message via the
> > web admin UI it has Persistent: true - see this screen shot
> > <http://qpid.2158936.n2.nabble.com/file/t396334/broker-j-msg-persist.png>
> .
> > I expected it to be Persistent: false based upon my change to NEVER and
> what
> > I understood from the documentation.
> >
> > Also, when I ran this Java code (using JMS 0.30.0 again), it returned a
> > value of 2 which indicates it is a persistent message:
> > MessageConsumer messageConsumer = session.createConsumer(destination);
> > TextMessage message = (TextMessage)messageConsumer.receive();
> > System.out.println(String.format("persist?: %s",
> > message.getJMSDeliveryMode()));
> >
> > However, after reading Alex's response of ' Thus, on broker restart the
> > queue entries would be removed. ' I thought I would see what would
> happen to
> > the message after the broker restart.  When I restarted the broker the
> > message was gone.
> >
> > So now I'm actually a little more confused that I originally was but
> perhaps
> > I'm not fully understanding this.   Being that the message was marked as
> > Persistent (even though I didn't want it to be) and the Queue is marked
> as
> > Durable (the checkbox is checked on the web admin UI), the message was
> lost
> > which doesn't seem right?
> >
> > The virtual host environment I have is a 3 VirtualHostNode setup for
> HA.  I
> > didn't test this on a single VirualHost node.
> >
> > Thanks
> > Bryan
> >
> >
> >
> > --
> > Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-
> f2158936.html
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> > For additional commands, e-mail: users-help@qpid.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message