Posts

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...

Installing IBM WebSphere MQ 8.0 in Ubuntu

Image
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 a message. IBM WebSphere MQ handles the different processors, operating systems, subsystems, and communication protocols it encounters in transferring the message. If a connection or a processor is temporarily unavailable, IBM WebSphere MQ queues the message and forwards it when the connection is back online.   What can IBM WebSphere MQ do for users?   IBM WebSphere MQ sends and receives data between your applications, and over networks. Message delivery is assured and decoupled from the application. Assured, because IBM WebSphere MQ exchanges messages transactionally, and decoupled, because applications do not have to check that messages they sent are delivered safely. You can secure message delivery between queue managers with SSL/TLS. With Advanced Message Security (AMS), you can e...

Google Summer of Code - Newbie thoughts

Image
Google Summer of Code is a global program focused on bringing more student developers into open source software development. Students work with an open source organization on a 3 month programming project during their break from school. In this post I thought of giving you some information on my experience about getting selected in Google Summer of Code. Brand yourself To get accepted in summer of code , a good proposal is not enough.You have to interact with the community and convince the people in the society that you are capable of doing things.One thing you can do is blogging.Through your blog you can share the knowledge that you have gained through your researches on the selected product of the company.(Apache,WSo2 etc..) .In the blog you can also include the personal ideas about the product and the errors occurred during your research.You may think that they are not very useful.But actually they are the most important information to an open source company so ...

SFTP file Transfer using JSch

Image
JSch(Java Secure Channel) is a Java implementation of SSH2, which allows you to connect to a sshd server and perform various operations like File Transfer, Port forwarding, etc. JSch is distributed under BSD License and you could get the jar from their official website or SourceForge. JSch is also available in the Central Maven Repository. Here’s how you could use JSch for file transfers on SSH2. Below are the four steps that you need to transfer files: Authentication Connection Set Path Transfer First we need to create a session with an authentication either by password or SSH keys. JSch jsch = new JSch(); Session session = jsch.getSession(CredentialsManager.getUser(),                 CredentialsManager.getHost(), CredentialsManager.getPort()); session.setPassword(CredentialsManager.getPassword()); java.util.Properties config = new java.util.Properties();        config.put("StrictHostKeyChecking"...