0
votes

Is it possible to bulk read messages from Solace queue rather than receiving them one by one on callback?

Currently MessageEventHandler receives about 20 messages per minute, this is too slow for our application.

Does anyone have a better solution to speed things up in Solace?

This is a C# application.
We used

ISession.CreateFlow(FlowProperties, IEndpoint, ISubscription,
EventHandler<MessageEventArgs>, EventHandler<FlowEventArgs>)

Passing in a MessageEventHandler which gets the message via MessageEventArgs.Message

queue = CreateQueue();  
Flow = Session.CreateFlow(flowProperties, queue, null, OnHandleMessageEvent, OnHandleFlowEvent);

..
void OnHandleMessageEvent(object sender, MessageEventArgs args)
{
var msgObj = args.Message.BinaryAttachment;
..
}
```
1

1 Answers

0
votes

No, there is no API call for a user to read messages in bulk.

By default, the API already obtaining messages from the message broker in batches, with each message being individualy delivered to the application in the message receive callback. FlowProperties.WindowSize and FlowProperties.MaxUnackedMessages can change this behavior.

20 messages per minute is extremely slow.

One common reason for slowness is that the application is taking a long time to process messages in the message receive callback ("OnHandleMessageEvent"). Blocking in the message receive callback will prevent the API from delivering another message to the application.

Refer to Do Not Block in Callbacks for details.