What is the IBM MQ XMS option that is equivalent to CMQC.MQSO_SET_CORREL_ID - c#-4.0

I am trying to consume the messages by a specific correlation ID. The JMS application that I talk to use CMQC.MQSO_SET_CORREL_ID. What is the equivalent option available to XMS .Net framework to subscribe messages with specific correlation ID using managed subscription?

Related

Determining how many messages are on the Azure Service Bus Queue for a specific SessionId

I have a servicebus queue that contains messages with different session ids.
Is there a way to get the message count for a specific session id?
You can retrieve the count of messages held in queues and subscriptions by using Azure Resource Manager and the Service Bus NamespaceManager APIs in the .NET Framework SDK as described here.
You can also refer the suggestions provided by the community members here. See if this helps you.

Azure Service Bus, check if ASB is throttled by using SDK

We use Azure Service Bus to send messages from one service to another. Producer produces quite huge amount of messages(a couple of millions) during 1-2 hours. As a result our Service Bus(we use Premium Azure Service Bus) is throttled and we receive errors on producer and consumer sides. I wonder if we could check somehow the load of our ASB by using Azure SDK(we use ASB Java SDK) and if it is high we can slow down the services that sends messages into the queue/topic.
I also understand that we can add more Premium units, but it is the last option we will take.
What we use:
Azure Service Bus Java SDK
Java 9 and Spring Boot 2.0
Azure Service Bus Premium version
Do you have any recommendations for my case? Any recommendation - patterns, frameworks, ASB SDK features would be great.
What you usually can do is to check from the portal your usage (from the overview panel), there is no feature in the SDK itself that can show you the load on your service bus namespace.
Since you're using premium messaging, there is no certain threshold that can determine if you've exceeded your messaging unit capacity or not.
you will get throttling errors as shown in the documentation:
Also be aware that you can scale up and down according to your usage with how many messaging units you want.

Azure Service Bus - Message Count in JAVA

How could i get the total number of unprocessed message count from Azure Service bus using JAVA. Is there any API that can show the total number of message that is yet to be processed.
Is there any equivalent to the below .Net library in JAVA link
.Net Namespace: Microsoft.ServiceBus.Messaging
Whats the equlant for the above .Net Namespace in JAVA?
Is there any API that can give me the number of message in the service
bus using JAVA?
You could refer to Message counters doc. You could use MessageCountDetails Class to get ActiveMessageCount property.
Which is equivalent to the .NET library MessageCount in java: https://learn.microsoft.com/en-us/java/api/com.microsoft.azure.management.servicebus._queue.messagecount
There are Java classes available for management of the Service Bus and I think the one you're looking for is MessageCountDetails. There are examples of how to use the management classes in their GitHub repo. Currently that uses version 0.9.7 of the Azure Service Bus libraries, but same classes seem to exist in the latest 2.0.0-PREVIEW-7.

Difference between BrokeredMessage class in Microsoft.ServiceBus and Message class in Microsoft.Azure.ServiceBus

I've got started with Azure Service Bus in Azure. Having gone through some references over the Internet, it seems that people use BrokeredMessage class in Microsoft.ServiceBus.Messaging rather than Message class in Microsoft.Azure.ServiceBus.
BrokeredMessage class: https://learn.microsoft.com/en-us/dotnet/api/microsoft.servicebus.messaging.brokeredmessage?view=azure-dotnet
Message class: https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.servicebus.message?view=azure-dotnet
I can send both of message 'types' to Azure Service Bus and also work with them over Azure Service Bus. Also, both can be used in Asynchronous operation. What are the main differences between the two types?
[Update] This article gives best practices of Azure Service Bus when exchaning brokered message (https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-performance-improvements). I'm unsure if it is also referred to Message in Microsoft.Azure.ServiceBus.
If it's a new project to use Azure Service Bus, I would recommend the following:
Prefer the new .NET Standard client (Microsoft.Azure.ServiceBus) with Message.
Be careful with documentation and various resources. They mostly cater to the old client (hopefully MSFT doco soon to change).
If you need transport transactions spanning different entities, the new client can't provide it yet.
If you need management operations, the new client won't provide it. Ever. Instead you'd have to use Management library or wait till a replacement package for NamespaceManager is out.
If you have old systems emitting messages sent as serialized data and not Stream, implementations using new Client have to know about it and use extension method provided by the client to process those messages. New client only deals with Stream based messages.
As Gaurav Mantiri mentioned that Microsoft.Azure.ServiceBus is the newer version of the library built using .Net Standard.
You could get the detail information from github.
This is the next generation Service Bus .NET client library that focuses on queues & topics. This library is built using .NET Standard 1.3.

Looking for a tool to stress test an application via Service Bus messages

I have an application that subscribes to an Azure Service Bus topic and processes the incoming messages. I would like to do a performance/stress test by constantly sending a very large batch of messages from different locations to the Service Bus and measure the processing time of my application.
Is there a tool out there to flood Service Bus?
I would recommend going for Apache JMeter, it is free, open source, scalable, GUI-based multiprotocol load testing tool.
Given you have Azure Libraries For Java in JMeter Classpath you should be able to use the following Test Elements:
JMS Publisher
JMS Subscriber
JMS Point-to-Point
to mimic the load on ASB.
See Building a JMS Testing Plan - Apache JMeter for details.
Another free and open source tool which can be used is Gatling, see JMS API Example for reference.
Have a look at the sample ASB team has once provided. Saying that, I'd like to warn about tooling - your benchmarking will be off if you're in the standard tier.
Challenge with standard tier is the noisy neighbor effect, when because of your (or someone else) operation you can get throttled.
With premium tier you can get the consistent and promised throughput.

Resources