Solace JMS Integration With WebSphere Liberty Profile

2y ago
49 Views
3 Downloads
1.04 MB
41 Pages
Last View : 3d ago
Last Download : 3m ago
Upload by : Jerry Bolanos
Transcription

Solace JMS Integration withWebSphere Liberty ProfileDocument Version 1.0July 2016This document is an integration guide for using Solace JMS (starting with version 7.1) as a JMSprovider for WebSphere Liberty Profile version 8.5.5.9.WebSphere Liberty provides a comprehensive framework for application and integrationmiddleware that is compliant with the Java Enterprise Edition computing platform. Solace providesa Java Connector Architecture (JCA) compliant Resource Adapter that may be deployed toWebSphere Liberty providing enterprise applications with connectivity to the Solace messagerouter.Solace message routers unify many kinds of data movement so co mpanies can efficiently andcost-effectively move all of the information associated with better serving customers and makingsmarter decisions. The Solace 3560 message router is the highest performance data movementtechnology available, with the capacity and robustness to support the most demanding enterprisemessaging, big data, cloud computing and Internet of Things applications.Note: Applications deployed in Websphere Liberty 8.5.5.9 using the Solace JCA Resource Adapterare subject to IBM bug PI48971.The fix is available in fix pack 16.0.0.2 or can be downloaded at http://www01.ibm.com/support/docview.wss?uid swg24042088.Copyright Solace Systems, Inc.http://www.solacesystems.com

Solace JMS Integration with WebSphere LibertyTable of ContentsSolace JMS Integration with WebSphere Liberty Profile . 1Table of Contents . 21 Overview . 31.1 Related Documentation . 32 Why Solace . 4Superior Performance. 4Robustness. 4Simple Architecture . 4Simple Operations. 4Cost Savings . 43Integrating with WebSphere Liberty Profile . 53.1 Description of Resources Required. 53.1.1 Solace Resource Naming Convention .53.1.2 Application Server Resource Naming Convention .63.1.3 Application Server Resources.63.2 Step 1 – Solace JMS provider Configuration. 73.2.13.2.23.2.33.2.4Creating a Message VPN.8Configuring Client Usernames & Profiles .8Setting up Guaranteed Messaging Endpoints .9Setting up Solace JNDI References.93.3 Step 2 – Configuring the WebSphere Liberty Profile to deploy the Solace JMS Resource Adapter. 113.4 Step 3 – Receiving inbound messages using Solace JMS provider. 113.4.1 Configuration.113.4.2 Receiving messages from Solace – Sample Code .123.5 Step 4 – Sending outbound messages using Solace JMS provider . 133.5.1 Sending Messages to Solace – Sample code.14456Performance Considerations. 17Working with Solace High Availability (HA) . 18Debugging Tips for Solace JMS API Integration . 196.1 How to enable Solace JMS API logging . 197Advanced Topics . 207.1 Authentication . 207.2 Using SSL Communication . 207.2.1 Configuring the Solace message router .207.2.2 Configuring Websphere Liberty for SSL connections.227.3 Working with XA Transactions . 247.3.1 Enabling XA Support for JMS Connection Factories.257.3.2 XA Transactions – Sample Code .257.3.3 Enabling Local Transaction Support for EJBs .307.4 Working with the Solace Disaster Recovery Solution . 307.4.17.4.27.4.37.4.48Appendix - Configuration and Java Source Reference . 338.18.28.38.48.58.68.79Configuring a Host List within the WebSphere Application Server .30Configuring reasonable JMS Reconnection Properties w ithin Solace JNDI .31Configuring Message Driven Bean Reactivation in the Event of Activation Failures .31Disaster Recovery Behavior Notes .32ProducerSB.java (Non-Transacted). 33XAProducerSB.java (XA Transacted / CMT) . 34XAProducerBMTSB.ja va (XA Transacted / BMT) . 35ConsumerMDB.java (Non-Transacted) . 36XAConsumerMDB.java (XA Transacted / CMT) . 37ejb-jar.xml . 38ibm-ejb-jar-bnd.xml . 39Appendix - Solace Resource Adapter and J2C Custom Properties. 402

Solace JMS Integration with WebSphere Liberty1 OverviewThis document demonstrates how to integrate Solace Java Message Service (JMS) with the WebSphere Liberty Profilefor production and consumption of JMS messages. The goal of this document is to outline best practices for thisintegration to enable efficient use of both the WebSphere Liberty Profile and Solace JMS.The target audience of this document is developers using the WebSphere Liberty Profile with knowledge of both theWebSphere Liberty Profile and JMS in general. As such this document focuses on the technical steps required toachieve the integration. For detailed background on either Solace JMS or the WebSphere Liberty Profile refer to thereferenced documents below.This document is divided into the following sections to cover the Solace JMS integration with WebSphere Libertyo Integrating with WebSphere Libertyo Performance Considerationso Working with Solace High Availabilityo Debugging Tipso Advanced Topics including:oUsing SSL CommunicationoWorking with XA TransactionsoWorking with Solace Disaster Recovery1.1 Related DocumentationThese documents contain information related to the feature defined in this documentDocument IDDocument TitleDocument Source[Solace-Portal]Solace Developer olace JMS Messaging APIDeveloper apideveloper-guide[Solace-JMSAPI]Solace JMS API Online ace Messaging Platform –Feature latformfeature-guide[Solace-FP]Solace Messaging Platform –Feature ce Message Router CommandLine Interface erence[WL-REF]WebSphere Application Server,Liberty D28V 8.5.5/as ditamaps/was855 welcome liberty core.htmlTable 1 - Related Documents.3

Solace JMS Integration with WebSphere Liberty2 Why SolaceSolace technology efficiently moves information between all kinds of applications, users and devices, anywh e re i n th eworld, over all kinds of networks. Solace makes its state-of-the-art data movement capabilities available vi a h a rd w a reand software “message routers” that can meet the needs of any application o r deployment environment. Solace’sunique solution offers unmatched capacity, performance, robustness and TCO so our customers can focus on s e i zi n gbusiness opportunities instead of building and maintaining complex data distribution infrastructure.Superior PerformanceSolace’s hardware and software messaging middleware products can cost-effectively meet the performance needs ofany application, with feature parity and interoperability that lets companies start small and scale to support highervolume or more demanding requirements over time, and purpose-built appliances that offer 50-100x higherperformance than any other technology for customers or applications that require extremely high capacity or lowlatency.RobustnessSolace offers high availability (HA) and disaster recovery (DR) without the need for 3rd party products, and fast failovertimes no other solution can match. Distributing data via dedicated TCP connections ensures an orderly, well -behavedsystem under load, and patented techniques ensure that the performance of publishers and high-speed consumers isnever impacted by slow consumers.Simple ArchitectureModern enterprises run applications that demand many kinds of data movement such as persistent messaging, webstreaming, WAN distribution and cloud-based communications. By supporting all kinds of data movement with a unifiedplatform that can be deployed as a small-footprint software broker or high-capacity rack-mounted appliance, Solace letsarchitects design an end-to-end infrastructure that’s easy to build applications for, integrate with existing technologies,secure and scale.Simple OperationsSolace’s solution features a shared administration framework for all kinds of data movement, deploymentmodels and network environments s o it’s easy for IT staff to deploy, monitor, manage and upgrade theirSolace-based messaging environment.Cost SavingsSolace reduces expenses with high-capacity hardware, flexible software, and the ability to deploy the right solution foreach problem. Solace’s support for many kinds of messaging lets you replace multiple messaging products with justone, built-in HA, DR, WAN and Web functionality eliminate the need for third -party products.4

Solace JMS Integration with WebSphere Liberty3 Integrating with WebSphere Liberty ProfileThis integration guide demonstrates how to configure a WebSphere Liberty Profile to send and receive JMS messagesusing a shared JMS connection. Accomplishing this requires completion of the following steps.o Step 1 - Configuration of the Solace message router.o Step 2 – Configuring the WebSphere Liberty Profile to use the Solace Resource Adapter.o Step 3 – Configuring the WebSphere Liberty Profile to send messages using Solace JMS.o Step 4 – Configuring the WebSphere Liberty Profile to receive messages using Solace JMS.3.1 Description of Resources RequiredThe Solace Resource Adapter is provided as a standalone RAR file and is versioned together with a specific release ofthe Solace JMS API. The JMS API libraries are bundled inside a single resource adapter RAR file for dep loyment tothe WebSphere application server.ResourceFile LocationSolace Resource Adapter stand-aloneRAR file Developer Portal: http://dev.solacesystems.com/downloads/ Solace Customer SFTP:https://sftp.solacesystems.com/ customer / version /Topic Routing/APIs/JMS/Current/ release /sol-jms-ra- release .rarTable 2 –Solace Resource Adapter Requirements3.1.1Solace Resource Naming ConventionTo illustrate this integration example, all named resources created on the Solace message router will have the followingprefixes:ResourcePrefixNon-JNDI resourcesolace resource name JNDI namesJNDI/Sol/ resource name Table 3 – Solace Resource Naming ConventionThe following Solace appliance resources are required.ResourceValueDescriptionSolace messagerouter IP:PortIP:PortThe IP address and port of the Solace message router messagebackbone. This is the address a client will use when connecting tothe Solace appliance to send and receive message. This documentuses a value of IP:PORT .Message VPNsolace VPNA Message VPN, or virtual message broker, to scope the integrationon the Solace appliance.Client Usernamesolace userThe client username.Client Passwordsolace passwordOptional client password.Solace Queuesolace requestsSolace destination for messages consumed by JEE enterprise5

Solace JMS Integration with WebSphere LibertyapplicationSolace Queuesolace repliesSolace destination for messages produced by JEE enterpriseapplicationJNDI ConnectionJNDI/Sol/CFThe JNDI Connection factory for controlling Solace JMS connectionFactorypropertiesJNDI Queue NameJNDI/Sol/Q/requestsThe JNDI name of the queue used in the samplesJNDI Queue NameJNDI/Sol/Q/repliesThe JNDI name of the queue used in the samplesTable 4 – Solace Configuration Resources3.1.2Application Server Resource Naming ConventionTo illustrate this integration example, all named resources created in WebSphere application server will have thefollowing prefixes:ResourcePrefixNon-JNDI resourcej2c resource name JNDI namesJNDI/J2C/ resource name Table 4 – Application Server Resource Naming Convention3.1.3Application Server ResourcesThe following WebSphere application server resources are required for the integration example in this document.ResourceID NameJNDI ValueDescriptionResource AdapterN/AN/AThe Solace JMS Resource Adapterpackaged as a Standalone RAR package(Implements a JCA compliant ResourceAdapter)J2C connectionfactoryj2c cfJNDI/J2C/CFA J2C entity used to access a Solacejavax.jms.ConnectionFactory (ForOutbound messaging)J2C activationspecificationj2c asJNDI/J2C/ASA J2C entity used to Cize a MessageDriven Bean and to bind it to a SolaceJMS destination using the Solaceimplementation ofjavax.jms.MessageListener(For Inbound messaging)J2C administeredobjectj2c request queueJNDI/J2C/Q/requestsA J2C entity used to perform a JNDIlookup of a javax.jms.Queue on theSolace message routerJ2C administeredobjectj2c reply queueJNDI/J2C/Q/repliesA J2C entity used to perform a JNDIlookup of a javax.jms.Queue on theSolace message router6

Solace JMS Integration with WebSphere Liberty3.2 Step 1 – Solace JMS provider ConfigurationThe following entities on the Solace message router need to be configured at a minimum to enable JMS to send andreceive messages within the WebSphere Application Server.o A Message VPN, or virtual message broker, to scope the integration on the Solace message router.o Client connectivity configurations like usernames and profileso Guaranteed messaging endpoints for receiving and sending messages.o Appropriate JNDI mappings enabling JMS clients to connect to the Solace appliance configuration.For reference, the CLI commands in the following sections are from SolOS version 6.2 but will generally be forwardcompatible. For more details related to Solace appliance CLI see [Solace -CLI]. Wherever possible, default values willbe used to minimize the required configuration. The CLI commands listed also assume that the CLI user has a GlobalAccess Level set to Admin. For details on CLI access levels please see [Solace -FG] section “User Authentication andAuthorization”.Also note that this configuration can also be easily performed using SolAdmin, Solace’s GUI management tool. This isin fact the recommended approach for configuring a Solace appliance. This document uses CLI as the reference toremain concise.7

Solace JMS Integration with WebSphere Liberty3.2.1Creating a Message VPNThis section outlines how to create a message-VPN called “solace VPN” on the Solace appliance with authenticationdisabled and 2GB of message spool quota for Guaranteed Messaging. This message -VPN name is required in theWebSphere Liberty Server configuration when connecting to the Solace messaging appliance. In practice appropriatevalues for authentication, message spool and other message -VPN properties should be chosen depending on the endapplication’s use case.(config)# create message-vpn solace VPN(config-msg-vpn)# authentication(config-msg-vpn-auth)# user-class client(config-msg-vpn-auth-user-class)# basic auth-type none(config-msg-vpn-auth-user-class)# exit(config-msg-vpn-auth)# exit(config-msg-vpn)# no shutdown(config-msg-vpn)# exit(config)#(config)# message-spool message-vpn solace VPN(config-message-spool)# max-spool-usage 2000(config-message-spool)# exit(config)#3.2.2Configuring Client Usernames & ProfilesThis section outlines how to update the default client-profile and how to create a client username for connecting to theSolace appliance. For the client-profile, it is important to enable guaranteed messaging for JMS messaging andtransacted sessions if using transactions.The chosen client username of “solace user” will be required by the WebSphere Liberty Server when connecting to theSolace appliance.(config)# client-profile default message-vpn solace VPN(config-client-profile)# message-spool file)# message-spool e)# message-spool allow-transacted-sessions(config-client-profile)# exit(config)#(config)# create client-username solace user message-vpn solace VPN(config-client-username)# acl-profile default(config-client-username)# client-profile default(config-client-username)# no shutdown(config-client-username)# exit(config)#8

Solace JMS Integration with WebSphere Liberty3.2.3Setting up Guaranteed Messaging EndpointsThis integration guide shows receiving messages and sending reply messages within the WebSphere ApplicationServer using two separate JMS Queues. For illustration purposes, these queues are chosen to be exclusive queueswith a message spool quota of 2GB matching quota associated with the message VPN. The queue names chosen are“solace requests” and “solace replies”.(config-message-spool)# create queue solace requests(config-message-spool-queue)# access-type exclusive(config-message-spool-queue)# max-spool-usage 2000(config-message-spool-queue)# permission all delete(config-message-spool-queue)# no shutdown(config-message-spool-queue)# exit(config-message-spool)# exit(config-message-spool)# create queue solace replies(config-message-spool-queue)# access-type exclusive(config-message-spool-queue)# max-spool-usage 2000(config-message-spool-queue)# permission all delete(config-message-spool-queue)# no shutdown(config-message-spool-queue)# exit(config-message-spool)# exit(config)#3.2.4Setting up Solace JNDI ReferencesTo enable the JMS clients to connect and look up the Queue destination required by the WebSphere Liberty Server,there are two JNDI objects required on the Solace appliance:o A connection factory: JNDI/Sol/CFo A queue destination: JNDI/Sol/Q/requestso A queue destination: JNDI/Sol/Q/repliesThey are configured as follows:9

Solace JMS Integration with WebSphere Liberty(config)# jndi message-vpn Solace VPN(config-jndi)# create connection-factory JNDI/Sol/CF(config-jndi-connection-factory)# property-list y-pl)# property default-delivery-mode persistent(config-jndi-connection-factory-pl)# exit(config-jndi-connection-factory)# property-list y-pl)# property direct-transport false(config-jndi-connection-factory-pl)# property "reconnect-retry-wait" "3000"(config-jndi-connection-factory-pl)# property "reconnect-retries" "20"(config-jndi-connection-factory-pl)# property "connect-retries-per-host" "5"(config-jndi-connection-factory-pl)# property "connect-retries" "1"(config-jndi-connection-factory-pl)# exit(config-jndi-connection-factory)# exit(config-jndi)#(config-jndi)# create queue JNDI/Sol/Q/requests(config-jndi-queue)# property physical-name Q/requests(config-jndi-queue)# exit(config-jndi)#(config-jndi)# create queue JNDI/Sol/Q/replies(config-jndi-queue)# property physical-name solace replies(config-jndi-queue)# exit(config-jndi)#(config-jndi)# no shutdown(config-jndi)# exit(config)#10

Solace JMS Integration with WebSphere Liberty3.3 Step 2 – Configuring the WebSphere Liberty Profile to deploy theSolace JMS Resource AdapterSolace provides a JCA compliant Resource Adapter that can be deployed to the WebSphere application server allowingEnterprise Java Beans to connect to Solace through a standard JCA interface. This integration guide outlines the stepsto configure the resource adapter which is provided by Solace as a packaged stand -alone RAR file.1.Add feature manager features?2.In the server.xml file, configure the stand-alone resource adapter by supplying an ID and specifying where theresource adapter RAR file is located (shown in below example as C:\ResourceAdapters\sol-jms-ra7.1.2.230.rar): resourceAdapter autoStart "true" id "solace" location "C:\ResourceAdapters\sol-jms-ra7.1.2.230.rar" /resourceAdapter 3.In between the resourceAdapter tags, specify the connectio n URL, username, password and Message VPNrequired to connect to the Solace Message Router. resourceAdapter autoStart "true" id "solace" location "C:\ResourceAdapters\sol-jms-ra7.1.2.230.rar" properties.solace ConnectionURL "smf:// IP:Port " UserName "solace user"Password "solace password" MessageVPN "solace VPN"/ /resourceAdapter 3.4 Step 3 – Receiving inbound messages using Solace JMS providerThis example uses an EJB Message Driven Bean to receive messages from the Solace JMS provider. The bean i sbound to a J2C activation specification which specifies the JMS destination from which to consume messages as wellas the authentication details used to connect to the Solace message router.3.4.1ConfigurationSteps to create a J2C activation specification:1.Add feature manager feature?2.In the server.xml file, add a new activation specification (use the value JNDI/J2C/AS for this example) activationSpec id "JNDI/J2C/AS" /activationSpec 3.Add custom properties to the new activation specification. Specify the name of the Connection Factory and thename of the queue servicing requests that was configured on the Solace message router in 3.2.4 Setting upSolace JNDI References. activationSpec id "JNDI/J2C/AS" properties.solace connectionFactoryJndiName "JNDI/Sol/CF"destination "JNDI/Sol/Q/requests" destinationType "javax.jms.Queue" / /activationSpec The following table summarizes the values used for the J2C activation specification custom properties:NameValueDescription11

Solace JMS Integration with WebSphere LibertyconnectionFactoryJndiNameJNDI/Sol/CFThe JNDI name of the JMS connection factory asconfigured on the Solace message router.destinationJNDI/Sol/Q/requestsThe JNDI name of the JMS destination asconfigured on the Solace message router.destinationTypejavax.jms.QueueThe JMS class name for the desired des tinationtype3.4.2Receiving messages from Solace – Sample CodeThe sample code below shows the implementation of a message-driven bean (ConsumerMDB) which listens for JMSmessages to arrive on the configured Solace JMS destination (JNDI/Sol/Q/requests - as configured in the activationspecification). Upon receiving a message, the MDB calls the method sendMessage() of the ProducerSB session beanwhich in turn sends a reply message to a ‘reply’ Queue destination . See section 8.7 for the relevant EJB applicationbinding file (ibm-ejb-jar-bnd.xml).12

Solace JMS Integration with WebSphere Liberty@MessageDriven@TransactionManagement(value te(value TransactionAttributeType.NOT SUPPORTED)public class ConsumerMDB implements MessageListener {@EJB(beanName "ProducerSB", beanInterface Producer.class)Producer sb;public ConsumerMDB() { }public void onMessage(Message message) {String msg ntThread().getName() " - ConsumerMDB: receivedmessage: " msg);try {// Send reply messagesb.sendMessage();} catch (JMSException e) {throw new EJBException("Error while sending reply message", e);}}}3.5 Step 4 – Sending outbound messages using Solace JMS providerThis example uses an EJB Session Bean to send reply messages using the Solace resource adapter. The bean coderequests a JMS Connection from a Solace J2C connection factory and then sends a reply message to a JMSdestination as configured by a J2C administered object. Both the connection factory and JMS destination arereferenced in the sample code using Java resource injection (‘myCF’, and ‘myReplyQueue’ respectively).Note, the J2C connection factory and J2C administered object are configured with the remote Solace JNDI names ofrespective connection factory and JMS destination.Steps to configure the WebSphere Liberty Profile:1.Create a JMS Connection with an ID of “j2c cf” in the server.xml file. Specify the JNDI name that will be usedto lookup this J2C Connection Factory. jmsConnectionFactory id "j2c cf" jndiName "JNDI/J2C/CF" /jmsConnectionFactory 2.Add a custom property called ‘ConnectionFactoryJNDIName’ and specify the name of the Connection Factorythat was configured on the Solace message router in 3.2.4 Setting up Solace JNDI References.13

Solace JMS Integration with WebSphere Liberty jmsConnectionFactory jndiName "JNDI/J2C/CF" properties.solace ConnectionFactoryJndiName "jndi/SolaceCF"/ /jmsConnectionFactory 4.Create a JMS Queue with an ID of “j2c reply queue”. This will be the queue that the session bean will publishreply messages to. Specify the J2C JNDI name (use a value of JNDI/J2S/Q/replies for this example). jmsQueue id "j2c reply queue" jndiName "JNDI/J2C/Q/replies" /jmsQueue 5.Add a custom property to the queue that defines the JNDI name on the Solace appliance. This is the queuename that was configured on the Solace message router in 3.2.4 Setting up Solace JNDI References. jmsQueue id "j2c reply queue" jndiName "JNDI/J2C/Q/replies" properties.solace destination "JNDI/Sol/Q/replies"/ /jmsQueue The following table summarizes the values used for the J2C administered object custom /Q/repliesThe JNDI name of the

Table 3 – Solace Resource Naming Convention The following Solace appliance resources are required. Resource Value Description Solace message router IP:Port _IP:Port_ The IP address and port of the Solace message router message backbone. This is the address a client will use when connecting to the Solace appliance to send and receive message.

Related Documents:

WebSphere Application Server WebSphere MQ Use the most appropriate protocol C .net Java C JMS COBOL Java Jacl JMS Jython Web-Sockets C# HTTP WebSphere Application Server is a fully compliant Java Enterprise Edition (JEE) application server. The Java Message Service (JMS) is the JEE application messaging protocol. WebSphere MQ provides a fully

Messaging system products (IBM WebSphere MQ, JBossMQ, SonicMQ, Fiorano, OpenJMS and ActiveMQ) provide implementations of JMS which can be plugged into the Gateway. The Gateway has been designed to allow 3rd party JMS providers to be "plugged in" for easy integration. To plug in a new JMS provider, you must install the JMS provider on the

114 Chapter 5 Concepts and Fundamentals of JMS Programming Figure 5.3 The pub/sub messaging service. The JMS API and the J2EE Platform Sun first released the JMS API in 1998.Its main purpose was to allow Java applications to work with MOM-based products.Because it was found very useful,many MOM vendors adopted and implemented the JMS API.In

The Oracle Retail Java Messaging Service (JMS) Console is a Web application for monitoring, browsing, and managing the messages that flow through a JMS system. This application is designed for the Oracle Streams Advanced Queuing (AQ) JMS provider. 360½ View of AQ JMS Monitor - provide an unattended view of JMS server.

In the three volumes of the IBM WebSphere Portal V4.1 Handbook, we cover WebSphere Portal Enable and Extend. The IBM WebSphere Portal V4.1 Handbook will help you to understand the WebSphere Portal architecture, how to install and configure WebSphere Portal, how to administer portal pages using WebSphere Portal; it will also discuss the

GlassFish Server 3.1 or later jms/MyQueue QM1 Orange Local Queue jms/MyGCF mypool ActivationSpec Config MDB TQUEUE QCF WebSphere MQ JMS client libraries WebSphere MQ 6.0/7.0 FileSystem Naming Context (used by . Oracle GlassFish Server 3.1 Administration Guide Author: Oracle Corporation

Download and install WebSphere MQ 2. Configure WebSphere MQ 3. Install OEG Gateway . Oracle Enterprise Gateway 6 / 30 4. Configure Gateway to send messages to WebSphere MQ 5. Configure Gateway to listen for messages from WebSphere MQ queue 6. Test Setup 2. Setting up the WebSphere MQ environment

Coronavirus is fatal in about two to three percent of cases. Health advice for the public is as follows: Wash your hands with warm water and soap for at least 20 seconds: After coughing or sneezing Before, during and after you prepare food Before eating After toilet use When you get in from the outdoors When hands are visibly dirty When caring for the .