Needing header to trace lost messages

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Needing header to trace lost messages

leejackson7@cox.net
Hi!  We have a consumer written using the cms_browserGetNextMessages function
written by Apache
(https://github.com/fusesource/fusemq-c/blob/master/fusemqc-client/src/main/cpp/CMS_QueueBrowser.cpp).
We are experiencing missing messages.  We post messages to a JMS Gateway.
The Gateway sends to a broker and we consume the messages off this broker.
We have been asked by the JMS Gateway team to update our consumer code
(written in C programming language) to include the header field as well as
the message we are pulling.  We currently just log the message.  Can someone
provide code or method to obtain the header for a specific message at the
consumer level?  We haven't been able to find where the header is accessible
to the consumer.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
Reply | Threaded
Open this post in threaded view
|

Re: Needing header to trace lost messages

tabish121@gmail.com
On 5/22/19 11:25 AM, [hidden email] wrote:

> Hi!  We have a consumer written using the cms_browserGetNextMessages function
> written by Apache
> (https://github.com/fusesource/fusemq-c/blob/master/fusemqc-client/src/main/cpp/CMS_QueueBrowser.cpp).
> We are experiencing missing messages.  We post messages to a JMS Gateway.
> The Gateway sends to a broker and we consume the messages off this broker.
> We have been asked by the JMS Gateway team to update our consumer code
> (written in C programming language) to include the header field as well as
> the message we are pulling.  We currently just log the message.  Can someone
> provide code or method to obtain the header for a specific message at the
> consumer level?  We haven't been able to find where the header is accessible
> to the consumer.
>
>
>
> --
> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>
When you receive a message at the consumer you read the message
properties using the API such as this one:

https://github.com/fusesource/fusemq-c/blob/master/fusemqc-client/src/main/cpp/CMS_Message.h#L228


--
Tim Bish

Reply | Threaded
Open this post in threaded view
|

Re: Needing header to trace lost messages

leejackson7@cox.net
Our header is a string value, so we tried using
cms_getMessageStringProperty(txtMessage, "OriginalDestination", key,
bufferLen).  It is failing with a return code of 1.  Any ideas?





--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
Reply | Threaded
Open this post in threaded view
|

Re: Needing header to trace lost messages

tabish121@gmail.com
On 5/22/19 1:10 PM, [hidden email] wrote:

> Our header is a string value, so we tried using
> cms_getMessageStringProperty(txtMessage, "OriginalDestination", key,
> bufferLen).  It is failing with a return code of 1.  Any ideas?
>
>
>
>
>
> --
> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>
I'd guess the message doesn't contain that property, you can of course
enumerate the properties to see what's there:

https://github.com/fusesource/fusemq-c/blob/master/fusemqc-client/src/main/cpp/CMS_Message.h#L198

--
Tim Bish

Reply | Threaded
Open this post in threaded view
|

Re: Needing header to trace lost messages

leejackson7@cox.net
Hi!  We were able to get the customer header and its value.  We still cannot
pinpoint the lost message issue.  Is there a way for the consumer to dump
all messages from the broker before it is reading them using the cms
library?

We appreciate the help!

Kim



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
Reply | Threaded
Open this post in threaded view
|

Re: Needing header to trace lost messages

Tim Bain
If you're looking to log messages on the broker, you'd want to write a
custom interceptor plugin. See https://activemq.apache.org/interceptors for
more details.

Note that the plugin must be in Java or another JVM language, not C++.

The other Tim


On Mon, Jun 3, 2019, 1:48 PM [hidden email] <[hidden email]>
wrote:

> Hi!  We were able to get the customer header and its value.  We still
> cannot
> pinpoint the lost message issue.  Is there a way for the consumer to dump
> all messages from the broker before it is reading them using the cms
> library?
>
> We appreciate the help!
>
> Kim
>
>
>
> --
> Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>