Can I use 2 phase commit between 2 queue connections - jboss

Recently I need to develop JBOSS application which receives IBM MQ Message.
It seems like use wmq.jmsra.rar and Message Driven Bean is a most common solution.
But I'm a little bit uncertain who is responsible of this Resouce.
IBM? or Redhat?
I'd rather develop my own queue connector daemon which read message from IBM MQ and send to JBOSS MDB using JMS.
In this case, I need 2 phase commit, to commit simultaneously both IBM MQ side and JBOSS side. Can I use something like XATransaction on this process? Is there any example on Web if it's possible.
Sorry, I couldn't find any example so far.
Many thanks.

wmq.jmsa.rar is released by IBM. Its found as part of the product. Go with the latest release WMQ 7.5 if possible.
WMQ supports XA transaction. It can participate as a resource manager in a 2 phase transaction coordinated by an external transaction monitor/application server.
Sample programs for Java XA transaction are not found with the installation. (I know I have seen C and Cobol XA samples).
http://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/index.jsp?topic=%2Fcom.ibm.mq.dev.doc%2Fq023590_.htm
http://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/index.jsp?topic=%2Fcom.ibm.mq.dev.doc%2Fq031500_.htm
You will require a local qmgr (application should run on the same server as qmgr to connect in bindings mode) or extended transactional client to connect to a remote qmgr using XA transactions.

Related

Connecting IBM iSeries to Kafka

We are trying to connect a process within our AS400 to deliver information to a database that is in SQL Server 2016. We have an Apache Kafka server running and ready. What is the best way to connect the i Series to SQL Server using Apache Kafka? in such a way that an RPGLE program can deliver a message subscribed to a specific topic in Kafka.
Should we install something additional? are there open source options?
What should we configure?
I suspect this should probably be closed...
But, I'll throw the following out here....
There's various ways for RPG to interact with REST services
open source HTTP API
IBM's own Integrated Web Services (IWS) client
Db2 built in functionality
various commercial libraries (GETURI for example)
Rather than interact directly from the producing RPGLE program, it's likely a better idea to have the RPG drop a message on a queue and have some background process send it out.
That background process could be all RPG, all Java, or RPG using Java classes.
JTOpen, aka JT400,is the opensource version of the IBM i Toolbox for Java.
If for instance you wanted an all Java process to read from the queue and send a message.
You can even throw Apache Camel into the mix since it supports both a JT400 and Kalfka connector. Here's an example repo of showing Camel running on the IBM i reading from a data queue and sending to Kalfka.

How to Read message from Jboss JMS Queue using IIB ESB Toolkit

I am working on a small project in which I want to consume the messages from the Jboss JMS Queue using IIB Tool kit. Apologize me that I am a learner in IIB.
The scenario is as below.
The Linux server is where the JBOSS is running and the messages are available in a particular JMS queue. I got IBM Toolkit installed on my laptop/machine and created an application and a flow. I placed the JMSInput from the pallet and got confused on where to configure the connection properties like IP Address, port number, Jboss user, password etc...
The idea is to consume the messages that are available in Linux server using IIB. Request some expert help on how to configure and achieve this requirement.
The jnp based Initial Context Factory seems like not supported in JBOSS 7 anymore. I would use the one described in Remote JNDI Lookup.
I never did an IIB integration with a JMS provider in JBoss, but I did it with a standalone ActiveMQ. There I created a JMSProviders configurable service, where I could configure IP address and port in the jndiBindingsLocation property like this:
mqsicreateconfigurableservice <BROKER> -c JMSProviders -o ActiveMQ \
-n initialContextFactory,jarsURL,jndiBindingsLocation,connectionFactoryName \
-v org.apache.activemq.jndi.ActiveMQInitialContextFactory,c:\Users\daniel\apache-activemq-5.11.1\lib,tcp://localhost:61616,ConnectionFactory
See Securing JMS connections and JNDI lookups how to enter user id and password.

Is it possible to connect to Webpshere MQ?

I am having an incredibly difficult time finding any information by IBM on how to connect to our company's queue. Some more specific questions:
do I need the queue manage?
how do I know which queue connection factory to use?
how do I connect to the queue from a standalone java application?
I honestly can't find any MODERN, up-to-date resources explaining the websphere mq and how to make use of it (this includes within my own company).
Thanks!
You can connect to a queue manager in either binding mode or client mode. Binding mode allows an application to connect to the queue manager only when they are both running on the same machine. Client mode allows an application to connect to the queue manager when the two a running on separate machines. You can use client mode when they are both running on the same machine but its not as efficient as binding mode.
If you want to use binding mode then you only need to know the queue manager name.
If you want to use client mode then you will need to know the queue manager name, hostname, listener port number, and channel name.
The following URL provides some information on using JMS to connect to MQ:
http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q031500_.htm

wmq: how to create queue via mq client connected to queue manager

I am running queue manager QM1 on am-wmq-ux01:1414, mq client is running on am-wmqc-ux01. I would be interested how can I create new mq objects on QM1 using mq client connection from am-wmqc-ux01?
Have a look at SupportPac MO72. It is a client-based version of runmqsc called mqsc. If you are suitably authorized (or if nobody bothered to secure the QMgr) then you can do anything with mqsc that you can with runmqsc.

How to JBoss/Blazeds clustering and channel failover

I'm stuck with jboss and blazeds clusterization.
What I have now is :
2 Jboss Instances, running in all mode
One load balancer with apache and mod_jk, as suggested by Jboss docs
A spring/flex integration app
A flex application that I do not want to throw errors when one of my JBoss instances falls
I find Adobe documentation really lacking, and being new at clustering, jgroups and balancing I cannot find how to deploy my app in clustered environment.
Actually this solution is working fine with remote calls. If one of jboss instances goes down the rpc gets routed to the other instance. What is not working are push messages, cause if client is connected to JBossA, and JBossA goes down, client displays an error message, stating that it can't reach JBossA, when it should failover to JBossB, without the user noticing anything.
From what I understood if configured correctly blazeds should tell flex client about failover servers upon connection. Then if flex client can't connect to the main server it goes to another. But the hard part for me is getting there.
Can someone point me to the right direction?
Thanks in advance
If you have an apache web server sitting between the clients and the JBoss servers, with mod_jk handling communication between apache and JBoss, then that should be your failover requirements met already.
mod_jk will detect if any of the JBoss servers fails, and send requests to the other one. As far as the clients are concerned, they see a single server, which is the apache server. They see nothing of the JBoss servers behind it.
I know nothing about BlazeDS clustering, but I'm guessing it has some form of manual failover mechanism, which it tells clients about a list of server addresses, and the clients pick one that works. This should only be necessary if you don't have a mod_jk middleman, so hopefully you can just ignore the blazeds clustering.
Things can, of course, get a lot more complicated, such as when you need to JBoss servers to commnunicate amongst themselves (e.g. session replication, clustered JMS, distributed caching, etc), but if you don't need any of that, then you can safely ignore it.