Can I start a standalone instance of JMS MQ Server for testing? - ibm-mq

Java.
I had to port away from the Proton MQ library to the IBM one. I had written a dummy MQ server to run jUnit tests against but I cannot see any way to achieve something similar with IBM MQ. To me it seems that it requires a standalone server and a license. Is that the case? Are there any lightweight alternatives usable for jUnit?
They mention that there is an IVTRun application which is actually just a wrapper over MQJMSIVT.class. Decompiling inside, I don't see anything that can start an actual server/queue manager. See this: https://www.ibm.com/docs/en/ibm-mq/9.2?topic=jms-point-point-ivt-mq-classes

You can run MQ natively, in a container or in the cloud. The container option lends itself to automated testing as the set up and start can be automated.
For detailed instructions see https://developer.ibm.com/series/mq-ready-set-connect/

Related

How to upload Spring Boot application using RabbitMQ messaging to AWS EC2?

I have a functioning application using Spring Boot, Rabbit MQ & MySQL DB locally. I'm curious, how I can upload this app to the AWS Environment and get it working seamlessly.
The only part where I'm lost is how to get RabbitMQ in the cloud? Any suggestions?
I see three options for your needs :
Use AmazonMQ managed service. This uses ActiveMQ under the hood, and supports the AMQP protocol (so you can continue to use the RabbitMQ client). Here's an article on how to do it : https://aws.amazon.com/blogs/compute/migrating-from-rabbitmq-to-amazon-mq/.
Use a third-party managed service (such as CloudAMQP). This is similar to the first option, but you can choose a RabbitMQ provider if you wish.
Install RabbitMQ on an EC2 instance and manage it yourself. This is the most flexible option, but it will require more effort on your part and it will probably cost more. I would recommend this option only if you have special requirements that are not met by using a hosted service.
In all cases, I would also recommend to use a messaging library such as Spring Messaging or Apache Camel to isolate your code from your messaging implementation. This will reduce the boilerplate code you need for messaging and allows you to focus on your application logic.

IBM Liberty message consumption with fail-over

We are designing a solution that will consume messages from IBM MQ using JMS. The plan is to use WAS Liberty, so JMS is the technology of choice. We will create Message-Drive beans that will listen for messages in MQ queues.
We are considering both WAS Liberty and OpenLiberty as well.
The trick here is that we must implement it with fail-over, so that if one of our server fail, the other will keep consuming messages from MQ automatically. Like in a ative/passive mechanism.
I'm aware that the MQ adapter needs to be installed as it is not provided out-of-the-box.
I have the following questions:
Does WAS Liberty messaging implementation supports fail-over? Meaning that if the ative message consumer node fails, the stand-by node will automatically migrate and start consuming messages from MQ? What about OpenLiberty?
How can I configure the message system to work that way? Can you point out to the documentation?
Or is this feature only provided by WebSphere?
There is no such functionality in WebSphere Liberty or Open Liberty yet. You can create RFE here https://www.ibm.com/developerworks/rfe/?PROD_ID=544 .
There are ways to do it manually, check these links:
JMS Activation spec on Liberty: “WAS_EndpointInitialState” full profile equivalent property?
Controlling the state of endpoints at runtime
Solution that you could do:
create a script/application that will monitor your servers and call that API to enable/disable endpoint in specific server
or use Dynamic cluster/ auto scaling feature of Liberty and divide you app to two clusters - one with MDBs, one without. And then define policy that MDBs cluster has 1 instance always available. So once the server dies it is automatically restarted somewhere in the cluster
or use Kubernetes/ICP platform in the same way - so deploying 2 versions of app, and defining different replicasets parameters.

Mocking a system communicating with JMS messages on IBM MQ?

I have two applications SystemA and SystemB communicating via request and response messages and using correlation IDs.
I would like to be able to test SystemA in isolation without having to rely on the availability of our IBM MQ broker and SystemB. Ideally I would like to do it in our continuous integration environment (Jenkins). I am looking for common approaches to this problem, before I code a solution myself in-house.
How can I create a mockup of the IBM MQ broker and SystemB for the purpose of testing SystemA in isolation?
Why mock the queue? Have you considered mocking the consumer from the queue instead? This would be simpler and would leave the queues in place for when the full featured service became available.
If you are looking for both basic and advanced mocking and simulation for developers and testers and would like to do black box testing have a look at Traffic Parrot and this mocking and simulating JMS IBM WebSphere MQ tutorial. It will work in Jenkins as well.
If you do not need to do black box testing, and can mock stuff in unit tests, just use mockito or a similar java mocking library.

Differences in bundle containers between Websphere and Karaf?

I'm evaluating options for my team's middleware. We really have a frankenstein'd setup. We're using Apache ServiceMix(Karaf/ActiveMQ/CXF), Websphere 8.5, ActiveMQ where we don't really need it, and all of our applications are not really coded to failover to another node if the primary goes down. We realized the issues of our setup and now want to improve.
We currently host bundles (not sure if they're all OSGI compliant) in a Karaf Container, which are used via ActiveMQ after being sent JMS messages via Apache Camel from Websphere.
My current idea is to kill off ActiveMQ, make all the camel routes towards HTTP (instead of JMS queues), and convert our data bundles/services to serve via HTTP through Apache CXF (replacing websphere for some things) and not ActiveMQ Queues/JMS. However, we have Websphere licenses, and I do know that it supports bundles in some way, I'm just not as familiar as to how it does (same nature as karaf)?
The main question is in the title, and I hope it's not too generic.
WebSphere 8.5 is a full OSGi container supporting Blueprint just as Karaf does.
You can, in theory, run your camel bundles or whatnot just as fine in WAS8.5. However, Apache Karaf is a lot more aligned towards running ActiveMQ/CXF/Camel stuff than WebSphere will ever be. Installation in Karaf is a few commands, where installation and configuration struggle in WAS85 for the Camel feauters and basic camel routes is .. well, a headace when I tried it last time. Others seems to have the same struggle.
I have rather good experience of running Camel apps inside WebSphere Application Server, but that was by embedding Camel in a standard WebApp, not using the OSGi stuff. So, embedded web apps is my recommendation for running Camel inside WebSphere.
For the "replace AMQ/JMS with HTTP" part. You are aware of that you are replacing pears with apples, right? JMS has a lot of features HTTP does not have (and some overhead compared to HTTP). For the sake of completeness, WebSphere also has a JMS provider built in. So if you have a large HA secured WebSphere infrastructure, the WebSphere (SIBus) provider might be a good choice. Otherwise, ActiveMQ rocks :-)

Pmi Client is not created while using with sun java instead of IBM java

My task to monitor the IBM Websphere through pmi client.Pmi client is an agent provided by the IBM to get MBeans and is running under IBM Java. I tried it to run under Sun java. But, it fails to create the Pmiclient. Did Anyone come across this issue?
The IBM JRE has slightly customized classes. This is unfortunately not uncommon with PMI (and also JMX by the way) when working with different WebSphere Application Server versions.
There are hacks around involving copying the relevant IBM implementations and running them with the Sun/Oracle JRE but I don't think that is valid according to the licensing terms. What you really should do is to use the IBM provided JRE.
If you want a riskless shortcut you will build an applicaton (perhaps EJB or servlets) that runs on the WebSphere Application Server and exposes the results from PMI via custom interface. For instance web service.

Resources