13.3.7 Connecting WebSphere MQ to the Service Integration Bus

To connect WebSphere MQ to the Service Integration Bus, the local Service Integration Bus must be defined. Refer to Configuring Embedded Messaging for the steps to the define the Service Integration Bus and add an the application server to the bus. Once completed, the following steps detail defining the foreign bus and the MQ Link for us in communicating with WebSphere MQ.

 

Defining the foreign bus

  • Open the Administrative Console and log in.

  • Click + next to Service integration.

  • Click Buses to display the list of defined buses.

  • Click the previously defined bus where the foreign bus will be defined to display the bus properties page.

  • Click Foreign buses to display the list of foreign buses defined on this Service Integration Bus

  • Click New to add a new foreign bus.

  • Enter a name and description for the foreign bus.

    Note: If foreign destinations will be used to communicate with MQ queues, enter the name of the MQ queue manager here. Otherwise any descriptive name will be fine.

  • If applications are not allowed to send messages to the foreign bus, uncheck the Send allowed check box.

  • Click Next.

    10. Select the Routing type. For communication to WebSphere MQ from the local bus via an MQ link select Direct, WebSphere MQ link.

    11. Click Next.

    12. Enter the name to use to authenticate inbound message flows in the Inbound user ID field.

    Note: All messages received from the foreign bus will appear to come from the id entered in the Inbound user ID field. This is important when the sender of the message is not authorized to access the Service Integration Bus or put messages to objects on the local Service Integration Bus.

    When a message enters the bus, the user ID that is stored in the message is checked against the local security. Initially the user ID is the user ID assigned to the message by the sending bus. That user ID may not have access to the local Service Integration Bus or resources, and may not even be known to the local User Registry. By entering a locally know user ID in the Inbound user ID field, the message can transmit into the local Service Integration Bus and all message coming from the foreign buss will appear to come from this local id.

    13. Enter the name to use to authenticate outbound message flows in the Outbound user ID field.

    Note: All messages sent to the foreign bus will appear to come from the id entered in the Outbound user ID field. On WebSphere MQ, this value will be in the UserIdentifier field of the message context.

    When a message enters a secure foreign bus, the user ID that is stored in the message. The user ID is initially set to the user ID of the message sender. This may not be appropriate, by entering a user ID here all messages will appear to come from the new user ID.

    14. Click Next.

    15. Click Finish to return to the foreign bus list page.

    16. Save the configuration for WebSphere.

    Defining the MQ link

  • Open the Administrative Console and login.

  • Click + to expand Service integration.

  • Click Buses to display the Service Integration Bus list page.

  • Click the Service Integration Bus where the foreign bus for MQ is defined to display the Service Integration Bus properties page.

  • Click Messaging engines to display a list of the messaging engines on the Service Integration Bus.

  • Click the messaging engine where the MQ link will be defined.

  • Click WebSphere MQ links.

    Note: WebSphere MQ client links are used to define a MQ link that will make the messaging engine appear as a queue manager to JMS clients connecting to it.Security for client links is handled by the roles discussed for embedded messaging communication in 13.2, Default JMS provider.

  • Click New to create a new WebSphere MQ link.

  • Enter a name and description for the link.

    10. Select the foreign bus from the Foreign bus name list. This is the foreign bus defined above.

    11. Enter a queue manager name. This is the name that the MQ link will appear to the MQ queue manager as and it is recommended not to use lowercase letters. This name will be used when defining the sender channel on the WebSphere MQ queue manager.

    12. Modify other properties as needed.

    13. Click Next.

    14. Enter a name for the sender channel. This must match a receiver channel defined on the MQ server.

    15. Enter the hostname and port of the MQ server queue manager.

    16. Select the Transport chain to use.

    Note: The transport chain determines the transport level security. Select OutboundSecureMQLink to use SSL when connecting to WebSphere MQ.

    17. Modify other properties as needed.

    18. Click Next.

    19. Enter a name for the receiver channel. This must match a sender channel defined on the WebSphere MQ queue manager.

    20. Modify other properties as needed.

    21. Click Next.

    22. Click Finish to return to the WebSphere MQ links list page.

    23. Save the configuration for WebSphere.

    Defining a foreign destination

    In order for an application to put a message on a queue on the MQ queue manager the local Service Integration Bus needs a Foreign destination definition defining the foreign bus, MQ queue manager, and destination, queue. The following steps detail how to define the foreign destination:

  • Open the Administrative Console and login.

  • Click + to expand Service integration.

  • Click Buses to display the Service Integration Bus list page.

  • Click the Service Integration Bus where the foreign destination will be defined to display the Service Integration Bus properties page.

  • Click Destinations to display the destinations list page.

  • Click New to create a new destination.

  • Select Foreign as the destination type and click Next.

  • Enter an Identifier for the destination.

    Note: The Identifier must match the name of the destination on the foreign bus. In the case of WebSphere MQ, this is the name of the queue defined on the queue manager.

  • Enter a description for the destination.

    10. Select the foreign bus from the bus list where this destination links to. For an MQ queue this is the name of the foreign bus defined for the MQ link.

    11. Modify other properties as needed.

    12. Click Next.

    13. Click Finish to return to the Destinations list page.

    14. Save the configuration for WebSphere.

    Defining the JMS objects

    Defining a JMS Connection Factory and JMS queue for queue destinations on the local Service Integration Bus has already been covered in , Configuring Embedded Messaging. When sending messages to a Foreign destination, the application connects to the local messaging engine. The connection factory used to connect to the local Service Integration Bus messaging engine can be reused to here. The steps to configure the JMS Connection Factory can be found in Define the JMS Objects.

    The steps to create a JMS queue destination for a foreign destination are identical to the steps detailed in Define the JMS objects with one difference. Rather than selecting the local Service Integration Bus name for the Bus name, select the name of the foreign bus used to connect to WebSphere MQ. Once the page refreshes select the Foreign destination from the Queue name field. All other steps are the same.