Posts

Showing posts from August, 2017

Writing java classes to perform queue and topic operations in IBM WebSphere MQ

Image
A WebSphere MQ queue is a named object on which applications can put messages, and from which applications can get messages.Messages are stored on a queue, so that if the putting application is expecting a reply to its message, it is free to do other work while waiting for that reply.Before a message can be put on a queue, the queue must have already been created. A queue is owned by a queue manager, and that queue manager can own many queues. However, each queue must have a name that is unique within that queue manager.Following you get an example of opening a queue to put message. MQQueueManager queueManager; //initialize the queue manager here MQQueue queue = queueManager.accessQueue("myqueue", CMQC.MQOO_OUTPUT); MQMessage mqMessage = new MQMessage(); //prepare message here queue.put(mqMessage); queue.close(); Below you get an example of opening a queue to get messages. MQQueue queue = queueManager.accessQueue("myqueue", CMQC.MQRC_READ_AHEAD_M...

Using SSL support for IBM WebSphere MQ Java Clients

Image
In the previous post we discussed about creating a basic connection with a queue manager.In this we'll focus on how we can add SSL support to the connection.First thing you need to do is to create a key repository for the queue manager.You can do this using the standard key management tool provided by the the IBM WebSphere MQ. In the second window make sure to tick the "stash password to a file" field.Next you need to add a certificate to this key database file.Select Personal Certificate section and click New Self Signed certificate.You ''ll be directed to the following window. The Key Label you enter needs in the future so make sure to insert a specific Key Label in the relevant field.Next thing need to do is create a Key Store file.Go to "Create a New Key Database File" and select DB-Type as jks. Now go to Signer certificate section and add the certificate you created to the key store file.Now copy the .kdb and .sth files to the S...

Writing Java classes to perform IBM MQ queue manager operations

Image
As you saw in earlier posts IBM WebSphere MQ is  messaging for applications. It sends messages across networks of diverse components. Your application connects to IBM WebSphere MQ to send or receive messages.IBM WebSphere MQ have a special set of structures called queue managers. Channels,queues,topics and all the components that we are going to discuss belong to a specific queue manager.So the first step of our programme is to establish a connection with a queue manager.In order to do this first we need to add the following three jars to our project. com.ibm.mq.allclient.jar providerutil.jar fscontext.jar These jars contain all the methods and constants that we need to initialize a connection with a queue manager.First we need to set up the environment for the connection.Look at the following code segment. MQEnvironment.hostname = "localhost"; MQEnvironment.channel = "mychannel"; MQEnvironment.port = 1414; MQEnvironment contains static fields tha...

Writing 3rd part connectors for wso2 esb

Image
A connector allows you to interact with a third-party product's functionality and data from your ESB message flow, enabling you to connect to and interact with the APIs of services such as Twitter, Salesforce, and JIRA. This means that if you have enabled the Twitter and Google Spreadsheet connectors in your ESB instance, your message flow could receive requests containing a user's Twitter name and password, log into the user's Twitter account, get a list of the user's followers, and write that information to a Google spreadsheet. You can use one or more connectors in order to manage generic use cases related to a business scenario that you may need to address. You can use the following maven archetype to generate the project template for a 3rd party connectors. Here you can change the artifactID to an artifactID you prefer. mvn org.apache.maven.plugins:maven-archetype-plugin: 2.4 :generate  -DarchetypeGroupId=org.wso2.carbon.extension.archetype  -Darchety...