Cannot Browse Non-Text Messages From Hawtio - jboss

Currently i'm working in implementing ActiveMQ message broker in my application. We are using RedHat JBoss Hawtio management console to browse the message. We are not able to read the ObjectMessage in the management console. Normal text messages are showing up fine. I saw similar problem already reported as a bug in Jboss issue tracker but i'm not seeing any solution. Would like to check with our community experts to see if anyone have some solution/workaround to this problem. This is the error message i'm seeing in management console.
Unsupported message body type which cannot be displayed by hawtio
https://issues.jboss.org/browse/ENTESB-4074

As concluded in https://issues.jboss.org/browse/ENTESB-4074 currently it's not possible to render ObjectMessage in hawtio. ActiveMQ needs to implement https://issues.apache.org/jira/browse/AMQ-4817 to realise the feature.
According to Claus in ENTESB-4074:
I assume an ObjectMessage is a java serialized object, even if you marshal that to bytes then the data is not readable by humans.

Related

ActiveMQ Artemis failing to deliver large messages

We are using ActiveMQ Artemis as a message broker in a Kubernetes environment. So far it works for small messages, but when sending larger messages, which are roughly between 150k and 200k, the messages are not delivered. The messages are being paged to disk as we see them in the large-messages directory, but they are not being redelivered after being paged.
In case this makes a difference, on the receiving client side, we are using the JavaScript Rhea package, and the sending client is a C++ app using QPid Proton.
We have scoured the internet and have not found any real solutions to this. We're hoping a solution is just a matter of a configuration setting somewhere. Does anyone have any suggestions to try?

How to read value of max-delivery-attempts from Java in a MessageListener

I have configured the redelivery settings in Wildfly 10 configuration some thing like below.
<address-setting name = "jms.queue.MyQueue"
redelivery-delay="2000" max-redelivery-delay="10000" max-delivery-attempts="5"
max-size-bytes="10485760" address-full-policy="FAIL"/>
I haven't configured the DLQ which I want to do myself.
When a message fails , I would like to move it to certain queue with the error in it. Unfortunately if I configure the DLQ, I only get the original message but not the reason why it failed.
For that I would like to read the JMSXDeliveryCount and decide if this is the last attempt. If so then Move it to some other queue myself with additional information.
is it possible to read the original setting as done in standalone-full.xml from my Queue while consuming the message?
The max-delivery-attempts setting is not defined in the JMS specification so in order to retrieve it from the server you'll need to use the Wildfly management API. There are a couple of ways to do this - native or HTTP. To be clear, this will make your application difficult to port to other potential JMS providers and/or Java application servers.
To avoid having to use the Wildfly management API you might consider setting a special property on the message from the producer to indicate how many times it should be delivered. Then you could just read this property in your consumer application and compare it to JMXSDeliveryCount. If you don't want to change the producer application you could probably accomplish the same thing using an Artemis outgoing interceptor to set the property on the message as it's being delivered to the consumer.

How to process the webservice xml message in mirth

How to process the webservice XML message in Mirth Connect 3.x?
If I understand your question correct, you are asking for how to configure Mirth to become a Web server. It's actually easy and hard at the same time.
The easy way - create a new channel and configure the Source connector as Web Service Listener. Deploy the channel and you have a web server waiting for SOAP messages to be sent to a configured IP port. But the structure of these SOAP messages is governed by Mirth WSDL at localhost:8081/services/Mirth?wsdl.
If you want the SOAP message structure to be different then you are going to deep dive into creating your own Java class and overriding default web service methods. There is no a single answer for that, it is a completely separate topic.
I hope you are asking how to consume XML webservice message in Mirth?..
If you are receiving specifically SOAP you need to set webservice listener as your source channel listener. (as said previous answer, you will have the URL)
Go to your transformer and type the following code:
logger.info(connectorMessage.getRawData());
Once you do this you can see the data you received inside Mirth on the logger area.

JMS | IBM Websphere Application Server 8.5 | How to see messages and their formats lying on queues

I am working on a POC wherein I am trying to achieve SOAP over JMS. Basically I'll be submitting my SOAP messages directly to the jms queue and a consumer will further read these SOAP messages and process them. The reason we want to stick to SOAP is because it is a standard formatand we'll not have to do something extra to design a new standard form messages.
For this poc I am using the default messaging provider which comes by default with IBM websphere app server 8.5. I referred to the following and I am able to submit my messages to queue. The problem is that I expected the SOAP to stay as XML/String on my queue however it is getting converted into a byte message.
I want to check the message and its type on my queue using some kind of queue browser tool which could work with IBM WAS8.5 . I googled and found that there are a lot of Queue browser tools available for servers like Glassfish etc but I couldn't find any tool or option for IBM WAS8.5?
Can you please guide me on what I can do to ensure that my SOAP message stays as XML on JMS queue and any GUI tool/option I could use to see the message and its type on Queue ?
Regards
Aakash
You can use the SIB Explorer tool to view the messages on the queue in WAS. The link to the tool is here.
There is also the SIB Destination Handler tool that allows you to perform more actions on the messages that you might find useful for your issue (like printing out properties etc). The SIB Destination Handler tool can be found here.
In addition to tools mentioned by whitfiea you can use web admin console and go to:
Buses > myBus > Destinations > myQueue > Queue points >
myQueue#rad9vmNode02.server1-myBus > (switch to the Runtime tab) > Messages
then select the message. You should be able to see the message contents.

How to get the number of JMS messages in a Topic

How do I get the number of JMS messages waiting to be consumed by a specific JMS message subscriber? I use the Topic model (publish/subscribe) and not the Queue model.
I want my MDB (message driven bean) to be able to figure out this information about the topic it listens to. To be clear; I want my MDB to get the number of messages waiting to be consumed.
I can't find any information in either on Internet or the documentation :(
I use JBoss Messaging 1.4.4.
AFAIK, JMS does not specify anything to count the number of messages in a destination.
You need to use JMX for this. Check out the MBean attributes of the Topic MBean in the documentation and/or the java documentation of TopicMBean#getMessageCounters(). The depth attribute of MessageCounter should be what you're looking for. But, to be honest, I don't know what you're gonna do with this information and if this has a sense for a Topic. A message will stay in a Topic as long as it hasn't been delivered to all subscribers and each subscriber typically hasn't any knowledge of its peers. So how would one MDB interpret a count of messages?
Also note that I couldn't find this MBean in JBoss Messaging 2.0.0.alpha1's javadoc. I don't know if it has been deprecated (according to the code in 1.4, it wasn't) or if the documentation is not up to date (after all, it's the alpha1 javadoc and I couldn't find a link for beta4).
EDIT: As skaffman pointed out, JBoss Messaging has been rebranded as HornetQ. It looks like there have been some changes in the API but concepts still apply. The documentation is here.
You can't, not with the JMS API. The internal JBossMessaging API may expose that information, but you'll have to go looking through that documentation to find it.