ibm-messaging / mq-dev-patterns

Code samples and messaging patterns for IBM MQ developers
Apache License 2.0
190 stars 163 forks source link

Dotnet examples unable to Balance on Uniform Cluster #193

Open RiaanJo opened 10 months ago

RiaanJo commented 10 months ago

Still investigating, but not sure if this is a limitation with the IBM.XMS NuGet package, or the dotnet examples themselves.

The dotnet samples don't seem to be able to be balanced when connected to a Uniform Cluster. Looking at the Queue Manager Application Status the BALANCED option is set to "NOTAPPLIC"

DIS APSTATUS(*) 8 : DIS APSTATUS(*) AMQ8932I: Display application status details. APPLNAME(bug\net6.0\ibmmq_samples.exe) CLUSTER(UNICLUSTER) COUNT(2) MOVCOUNT(0)BALANCED(NOTAPPLIC) TYPE(APPL)

Any advise would be kindly appreciated.

chughts commented 10 months ago

When the samples were written, balancing on a uniform cluster wasn't taken into account. If you can fix the code, we will accept pull requests.

RiaanJo commented 10 months ago

Hi @chughts,

I've created a Fork and Branch where I've updated the dotnet Simple Get sample. That said, I'm not sure if this will still be inline with the base flow for the mq-dev-patterns.

See: https://github.com/RiaanJo/mq-dev-patterns/tree/Updating-for-Uniform-Cluster

To allow UNICLUSTER connections, using a DEVELOPER IBM MQ container (https://developer.ibm.com/tutorials/mq-connect-app-queue-manager-containers/), and test developer code in a UNICLUSTER as per https://github.com/ibm-messaging/mq-uniform-clusters, the simplest change is to just allow reconnects for the application.

I've not tried it on the other consumer samples. But in theory it should work too. I think the PUB/SUB model may need a bit more work though. and the REQUEST/RESPONCE may need a bit more work. Not sure the current UNICLUSTER example is really setup for it.

Please let me know what you think.