screenshot_2014_06_14 14_36_15


Update 2016-11-01:- Please note that the IBM MQ Light Bluemix service has been retired. See
MQ Light retirement schedule blog.
To use the MQ Light API in Bluemix, try
Message Hub.


The IBM provided beta Elastic MQ Service in Bluemix has been renamed Рor more accurately replaced Рby the beta MQ Light service.  The new name reflects the close tie between the MQ Light service and the standalone MQ Light API and runtime.

Under the covers we have made some major architectural changes to better support location transparency but from an external point of view the new MQ Light service is largely the same as the old Elastic MQ service.
 
The one major external difference between Elastic MQ and MQ Light service is in the way that an application connects to a service:  In the old Elastic MQ service an application would query the VCAP_SERVICES environment variable and connect with the hostname/port it found in the credentials.  In the new API the application still queries VCAP_SERVICES but instead of the hostname/port it uses the connectionLookupURI (see below).  This URL points to information that the MQ Light client code uses to bootstrap a connection to the service instance.
 

screenshot_2014_06_14 14_37_32

The way you handle the connectionLookupURI depends on whether you are using MQ Light Java JMS API, or the MQ Light JavaScript node.js API

For most JMS applications everything if taken care of for you. ¬†If you’ve written a JEE application which gets a jmsConnectionFactory¬†from JNDI then the connection lookup is all handled transparently under the covers. ¬†Similarly if you use the JSE MQ Light Java¬†connection¬†helper¬†sample then everything happens automatically when you call¬†getJmsConnectionFactory¬†(just make sure you are using the¬†MQLightConnectionHelper instead of the ElasticMQ helper).

 The only situation where you need to do any work to migrate an Elastic MQ application to this new scheme is if you are deploying a JEE application in a Liberty server package and have manually configured a jmsConnectionFactory or jmsActivationSpec.  In that case instead of setting the hostName and port attributes you must ensure that you set the ccdturl attribute in the jmsConnectionFactory or jmsActivationSpec to the connectionLookupURI as shown in the example below.

<jmsConnectionFactory jndiName="jms/CF1" connectionManagerRef="ConMgr6">
 <properties.wmqJms
  ccdturl="${cloud.services.mqlsampleservice.connection.connectionLookupURI}&amp;format=CCDT"
  username="${cloud.services.mqlsampleservice.connection.username}"
  password="${cloud.services.mqlsampleservice.connection.password}"      
 />
 

Note that the literal “&format=CCDT” is appended to the URL. ¬†This gives you a hint of the technology behind the JMS connection lookup. ¬†Under the covers the MQ Light JMS client is actually¬†using a MQ¬†client¬†channel¬†definition¬†table¬†to make the connection.

Handling the connectionLookupURI in MQ Light JavaScript node.js applications is also straightforward.  Simply extract the URL from VCAP_SERVICES and assign it to the service field in the options object passed into mqlight.createClient as shown below.

require "mqlight"
var opts;
if (process.env.VCAP_SERVICES) {
    var services = JSON.parse(process.env.VCAP_SERVICES);
    if (services[ 'mqlight' ] != null)
    {
        username = services [ 'mqlight' ][0].credentials.username;
        password = services [ 'mqlight' ][0].credentials.password;
        connectionLookupURI = services [ 'mqlight' ][0].credentials.connectionLookupURI;
    }
    opts = { user: username , password: password, service: connectionLookupURI , id:id};
} else {
    opts = { service:'amqp://localhost:5672',id:id};
}
var client = mqlight.createClient(opts);
client.connect(function(err)

 

How are Existing Elastic MQ service instances affected by this change?

Existing Elastic MQ service instances will continue to work, but it is no longer possible to provision instances of the Elastic MQ service beta.  You should start to plan migrating your applications to the MQ Light service beta.  We will keep all existing Elastic MQ instances running until at least the end of June but if you need more time or help migrating then please get in touch.  As always feedback is welcome.

 

<

p dir=”ltr”>(edited to remove reference to the¬†custom buildpack. ¬†That is no longer required when you push an application)

Join The Discussion

Your email address will not be published.