Search code examples
c#biztalkibm-mqbiztalk-2013

Dynamically set Endpoint definition in BizTalk Send Port using MQSeries adapter


Introduction

We exchange income data with an external party. Each year income tax regulations change and a new message schema has to be implemented. Altogether we now have 8 different schema versions each of which are deployed in a separate 'year income tax' application and this amount increases by 1 each year.

Because we pay our hosting company per installed application, we want to decrease the amount of applications installed.

All these applications are functionally equal, which means we validate incoming messages, and forward valid messages into a specific MQSeries queue. Each invalid message is routed to a response queue. Each application has it's own 'valid' and 'invalid' message queues.

The plan

One generic application that processes all 8(+) messages. New schemas must be deployable without application changes or downtime for previous, running 'income year tax' flows.

So far...

I can receive multiple messages on the same BizTalk receive port (MessageType XmlDocument) and am able to validate these messages dynamically in an orchestration by calling a custom receive pipeline (XML Disassembler + XML Validator). Exceptions as well as valid messages are processed as prescribed. There are no references between the Schemas and the generic application, so schemas can be deployed without need to stop running processes. So far, so good.

The orchestration has 1 receive shape, and 2 send shapes (valid, invalid).

SSO contains the values for routing the 'valid' and 'invalid' messages to their correct queue. Based on the incoming messagetype SSO is questioned for the correct 'valid' or 'invalid' queuedefinition.

The problem

I have previously dealt with dynamic FTP, FILE, WCF and SMTP ports, which all worked flawlessly after supplying the adapter with the correct Context Properties. Even MSMQ seems to have a fairly straightforward approach on dynamically setting transport properties.

However, I cannot seem to find MQSeries MQMT ContextProperties to set the queuedefinition dynamically.

Microsoft does not provide much information on this, and extensive searches on the internet hasn't provided me with anything useful (examples) either.

I tried matching IBM's docs with Microsoft's, but altogether I am now stuck.


Solution

  • I would suggest to use MQSC adapter for IBM MQ integration. It is part of Host Integration Server MSI. It only requires MQ client to be installed on the server Vs MQ Server for Windows installation required by MQSeries adapter.

    Set the OutboundTransportLocation property in following format mqsc://{channelName}/tcp/{server{({port})/{queuemanager}/{queuename}

    TransportType = MQSC

    Context Properties - Schema can be found within assembly MQSeriesEx.MQSPropertySchemaEx with namespace (http://schemas.microsoft.com/BizTalk/2003/mqs-properties).

    There are only few context properties you would need to set if at all required.

    • Channel_HeartBeat
    • Channel_MaxMessageLength
    • Channel_UserId
    • Channel_Password
    • ConnectionTimeout

    If additional properties are required than use MQSeries.MQSPropertySchema context properties.