Message subscription API - Msg Retrieves 1 message only

When I go to retrieve the messages that are part of my subscription/channel, the count in the console dashboard is more than 1 (i.e. 5 separate messages) but the response from the Message retrieval API call only returns 1 message. I was expecting an array of all the messages. Am I missing something I should be setting up.?

Hello, Roy!
Are you sure that messages are still in channel when you poll them? They live only for a short time (near 30 seconds), so, maybe, the first 4 messages are already gone.
Also it would be helpful if you describe steps to reproduce this issue, an write us what SDK you’re using for subscribing.
best regards,
Alex Navara

I’m use the REST API to interface with the Message service. I do see the messages in the channel at the time of the retrieve API call.

I will publish multiple messages for a channel and then immediately try and retrieve these messages.

When publishing I used a basic message call like {“message” : “Test”}

I just added the repeatEvery option, when retreiving the available published messages I do get an array of messages as expected. ({“message” : “Test”, “repeatedEvery” : 20}

Unfortunately, I cannot reproduce this issue.
Let me give you an example of my steps and this way we shall find the differences:

  1. Subscribe to default channel. Request: POST /v1/messaging/default/subscribe. Here I get subscription Id.
  2. Post a few messages to default channel through Messaging console
  3. Run request GET /v1/messaging/default/<subscriptionId>
    On the last step I receive a list of messages, just as expected.
    Can you tell me what’s different in your case?
    Thank you!

The first difference is the use of the default channel. I am using a unique channel. I will try and switch to use a default channel and let you know if I still have the problem.

In my case it also works for custom channel.

The default at this time is returning an array of the messages. Looks like it only happens when you specified another channel other than default.

I created a new channel and published many messages and without any changes, the retrieval message array contains all messages as expected.

If I understood you correctly, you’re saying that with a non-defauilt channel you get multiple messages at once, but with the default one, only one message is returned?

Early today, the non-default channel was only returning 1 message and the default one returned multiple messages. Since this afternoon, both type of channels are returning multiple messages. Not sure what that short term was.

Perhaps it is somehow related to the upgrade we were performing, but I do not see how it would be possible. I apologize for the inconvenience, and please let us know if it happens again.

Mark,

Will let you know if and when it does happen again. Estimated time of finishing the upgrade?

The upgrade is complete now.