You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by bltw15 <be...@gmail.com> on 2021/02/10 08:44:16 UTC

broker j REST API getMessageContent help

I'm trying to retrieve message content from the queue, but can't seem to get
it right. What is an example of using getMessageContent, and where can I
find the messageId?

http://localhost:8080/api/latest/queue/default/default/TempQueue148d546b-ee1d-4d6d-ba60-f5964f4a5aa2/getMessageContent?messageId=1

return:
  "errorMessage" : "Cannot parse body"

http://localhost:8080/api/latest/queue/default/default/TempQueue148d546b-ee1d-4d6d-ba60-f5964f4a5aa2
return:
{
    "id": "e358e151-a8ec-48cc-a7b2-de33d67a0e0e",
    "name": "TempQueue148d546b-ee1d-4d6d-ba60-f5964f4a5aa2",
    "type": "standard",

...




--
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


Re: broker j REST API getMessageContent help

Posted by bltw15 <be...@gmail.com>.
I don't see any log corresponding to this in the broker log.  Is there a
specific place the stack trace show up?



--
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


Re: broker j REST API getMessageContent help

Posted by Rob Godfrey <ro...@gmail.com>.
Did you see any sort of Java stack trace in the logs corresponding to this
issue?  If so, can you paste the stack trace here?

Thanks,
Rob

On Wed, 10 Feb 2021 at 09:45, bltw15 <be...@gmail.com> wrote:

> I'm trying to retrieve message content from the queue, but can't seem to
> get
> it right. What is an example of using getMessageContent, and where can I
> find the messageId?
>
>
> http://localhost:8080/api/latest/queue/default/default/TempQueue148d546b-ee1d-4d6d-ba60-f5964f4a5aa2/getMessageContent?messageId=1
>
> return:
>   "errorMessage" : "Cannot parse body"
>
>
> http://localhost:8080/api/latest/queue/default/default/TempQueue148d546b-ee1d-4d6d-ba60-f5964f4a5aa2
> return:
> {
>     "id": "e358e151-a8ec-48cc-a7b2-de33d67a0e0e",
>     "name": "TempQueue148d546b-ee1d-4d6d-ba60-f5964f4a5aa2",
>     "type": "standard",
>
> ...
>
>
>
>
> --
> 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
>
>

Re: broker j REST API getMessageContent help

Posted by Oleksandr Rudyy <or...@gmail.com>.
Hi,
As per error message "Operation 'getMessageContent' can only be
performed over a secure (HTTPS) connection", you need to use https in
order to call getMessageContent. The message content can contain
sensitive private information.  In order to protect that information
from eye dropping a secure transport is required by default. You can
remove this restriction by setting attribute
allowConfidentialOperationsOnInsecureChannels to true on HTTP port.

The statistics queueDepthMessages=0 indicate that there is no message
on the queue. Thus, an operation getMessingInfo returns an empty
array: [].

Kind Regards,
Alex

On Thu, 11 Feb 2021 at 20:48, bltw15 <be...@gmail.com> wrote:
>
> Thank you for pointing that out Alex.
>
> I tried again with curl ( I was using Postman)
> curl --user guest -X POST -d '{"messageId":1}'
> http://localhost:8080/api/latest/queue/default/default/TempQueue344060fa-b39c-4953-87bd-b98567f61e4e/getMessageContent
> Enter host password for user 'guest':
> {
>   "errorMessage" : "Operation 'getMessageContent' can only be performed over
> a secure (HTTPS) connection"
> }
>
> can you point me to what it is I'm missing?
>
> getMessingInfo returns an empty array: []
>
> Although I think there are messages getting into the queue, but may be it's
> also blocked from getting the content for the same reason above?
> Statistics:
> availableBytes  0
> availableBytesHighWatermark     7080
> availableMessages       0
> availableMessagesHighWatermark  3
> bindingCount    1
> consumerCount   1
> consumerCountWithCredit 1
> oldestMessageAge        0
> persistentDequeuedBytes 0
> persistentDequeuedMessages      0
> persistentEnqueuedBytes 0
> persistentEnqueuedMessages      0
> queueDepthBytes 0
> queueDepthBytesHighWatermark    9440
> queueDepthMessages      0
> queueDepthMessagesHighWatermark 4
> totalDequeuedBytes      121445600
> totalDequeuedMessages   51460
> totalEnqueuedBytes      121445600
> totalEnqueuedMessages   51460
> totalExpiredBytes       0
> totalExpiredMessages    0
> totalMalformedBytes     0
> totalMalformedMessages  0
> unacknowledgedBytes     0
> unacknowledgedMessages  0
>
>
>
> --
> 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


Re: broker j REST API getMessageContent help

Posted by bltw15 <be...@gmail.com>.
Thank you for pointing that out Alex.  

I tried again with curl ( I was using Postman)
curl --user guest -X POST -d '{"messageId":1}'
http://localhost:8080/api/latest/queue/default/default/TempQueue344060fa-b39c-4953-87bd-b98567f61e4e/getMessageContent
Enter host password for user 'guest':
{
  "errorMessage" : "Operation 'getMessageContent' can only be performed over
a secure (HTTPS) connection"
}

can you point me to what it is I'm missing?

getMessingInfo returns an empty array: []

Although I think there are messages getting into the queue, but may be it's
also blocked from getting the content for the same reason above?
Statistics:
availableBytes	0
availableBytesHighWatermark	7080
availableMessages	0
availableMessagesHighWatermark	3
bindingCount	1
consumerCount	1
consumerCountWithCredit	1
oldestMessageAge	0
persistentDequeuedBytes	0
persistentDequeuedMessages	0
persistentEnqueuedBytes	0
persistentEnqueuedMessages	0
queueDepthBytes	0
queueDepthBytesHighWatermark	9440
queueDepthMessages	0
queueDepthMessagesHighWatermark	4
totalDequeuedBytes	121445600
totalDequeuedMessages	51460
totalEnqueuedBytes	121445600
totalEnqueuedMessages	51460
totalExpiredBytes	0
totalExpiredMessages	0
totalMalformedBytes	0
totalMalformedMessages	0
unacknowledgedBytes	0
unacknowledgedMessages	0



--
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


Re: broker j REST API getMessageContent help

Posted by Oleksandr Rudyy <or...@gmail.com>.
Hi,

It seems that you invoked getMessageContent API using either method
POST or PUT rather than GET.

If PUT/POST is required to use, you need to specify operation
parameters in a message body. Something like

curl --user admin -X POST -d '{"messageId":1}'
http://localhost:8080/api/latest/queue/default/default/TempQueue148d546b-ee1d-4d6d-ba60-f5964f4a5aa2/getMessageContent

You can only set operation parameters as a query string with GET method.


curl --user admin -X GET
http://localhost:8080/api/latest/queue/default/default/TempQueue148d546b-ee1d-4d6d-ba60-f5964f4a5aa2/getMessageContent?messageId=1

As for message id values, you can get message ids by invoking
operation /api/latest/<vhn name>/<vh name>/<queue
name>/getMessageInfo.

Kind Regards,
Alex

On Wed, 10 Feb 2021 at 08:45, bltw15 <be...@gmail.com> wrote:
>
> I'm trying to retrieve message content from the queue, but can't seem to get
> it right. What is an example of using getMessageContent, and where can I
> find the messageId?
>
> http://localhost:8080/api/latest/queue/default/default/TempQueue148d546b-ee1d-4d6d-ba60-f5964f4a5aa2/getMessageContent?messageId=1
>
> return:
>   "errorMessage" : "Cannot parse body"
>
> http://localhost:8080/api/latest/queue/default/default/TempQueue148d546b-ee1d-4d6d-ba60-f5964f4a5aa2
> return:
> {
>     "id": "e358e151-a8ec-48cc-a7b2-de33d67a0e0e",
>     "name": "TempQueue148d546b-ee1d-4d6d-ba60-f5964f4a5aa2",
>     "type": "standard",
>
> ...
>
>
>
>
> --
> 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