3

I am trying to handle the QueueNotFound error in some SessionEventArgs when trying to send a Solace message.

Here's how the SessionEventArgs look while debugging: SessionEventArgs info

The response code comes back as 400 but I'm wary of that code being used for errors other than QueueNotFound.

Apart from checking the info string for "Queue Not Found", is there any other way of asserting that the error is indeed to do with Solace queue not existing?

nmit
  • 45
  • 5

1 Answers1

2

You can invoke the ContextFactory.Instance.GetLastSDKErrorInfo() method from within your session event delegate. This will return an SDKErrorInfo instance, which contains more information on the reported session event.

The SDKErrorInfo instance has a SubCode field that will indicate the exact type of error. If the error is Queue Not Found, the subcode enum will be SDKErrorSubcode.QueueNotFound. You can check in the Solclient.chm help document for a list of all SDKErrorSubcode enumerations, as well as their associated response codes.

There is a clear example of how to utilize the ContextFactory.Instance.GetLastSDKErrorInfo() method in the Replication.cs sample that is packaged with the Solace .NET API.

Alexandra Masse
  • 1,153
  • 1
  • 6
  • 11
  • Thanks for your answer. It is very helpful. Is it safe to make the ContextFactory.Instance.GetLastSDKErrorInfo() call multiple times or is there a reason why I should minimise the number of times I call it? – nmit Dec 04 '15 at 10:50