I'm trying to configure my NServiceBus project to use WebSphere mq. I've been searching all other the web and didn't find any up to date examples. according to this post there is a dll that exposes API for WMQ configuration. However, their example works with really old NServiceBus version and is not compatible for the current (4.3.1) version. The only manual that has some real examples is this one and is for PubSuB and not for simple client server configuration. Can anyone please direct me to a up to date example that describes how should I configure my NSB project to use WMQ.
Thanks!
i have migrated NServiceBus.WebSphereMQ to the version 5 of NServiceBus. Having used the solution for a P.O.C. the implementation is not very elegant and, therefore, I have not had the courage to publish it on Git Hub :-D.
In the P.O.C. i have created two endpoints using the NServiceBus.WebSphereMQ transport.
The configuration is quite simple.
Inside each Endpoint's config file (app.config) i have specified the following settings:
<configSections>
...
<section name="MessageForwardingInCaseOfFaultConfig" type="NServiceBus.Config.MessageForwardingInCaseOfFaultConfig, NServiceBus.Core" />
<section name="AuditConfig" type="NServiceBus.Config.AuditConfig, NServiceBus.Core" />
...
</configSections>
<AuditConfig QueueName="audit" />
<MessageForwardingInCaseOfFaultConfig ErrorQueue="error" />
...
<connectionStrings>
<add name="NServiceBus/Transport" connectionString="hostname=localhost;port=1414;queueManager=NEOS;channel=NEOS;" />
</connectionStrings>
It's important to pay attention to the connection string. QueueManager name and Channel name are very important informations and will be specified later. Using ServiceMatrix for VisualStudio 2013, i have automatically generated the EndpointConfig file, specifying the transport's logic inside:
public partial class EndpointConfig : IConfigureThisEndpoint, AsA_Server
{
public void Customize(BusConfiguration configuration)
{
configuration.UseSerialization<JsonSerializer>();
configuration.UsePersistence<InMemoryPersistence>();
configuration.UseTransport<WebSphereMQ>();
}
}
That's all code side.
To test the communication using MQ, i downloaded WebSphere MQ Advanced from the IBM website ( it's free ): http://www-01.ibm.com/support/docview.wss?uid=swg24032734 If you install the version 7.5, remember to install the recommended hotfixes!
First of all you have to configure a QueueManager. To do this i used WebSphere MQ Explorer tool as shown below:
Then, you must create a Server-Connection channel:
To use the channel you must provide grant authorization
At this point each Endpoint is able to create all queues automatically the first time running. It works great!
I hope I was helpful