FAQ Database Discussion Community


Getting spring-batch to work with transactional DMLC?

java,spring,jms,activemq,spring-batch
I am trying to setup jms message listener so that it picks up a certain amount of messages from a JMS broker (ActiveMQ) within the same transaction and should any error occur, the transaction is rolled back so that all message contained within that transaction end up in DLQ, or...

Should the JMSMessageID change between publish and subscribe?

jms,websphere-mq
The JMS 2.0 specification says The JMSMessageID header field contains a value that uniquely identifies each message sent by a provider. ...and... The exact scope of uniqueness is provider defined. It should at least cover all messages for a specific installation of a provider where an installation is some connected...

Write a Java Program to connect to HornetQ Messaging Service in Jboss EAP 6.3?

java,jboss,jms,hornetq
I am using Jboss EAP 6.3 and need to use Messaging facility. I have worked in Jboss 4x, where we can make connection easily using following code: public static final String PROVIDER_URL = "jnp://localhost:5445"; public static final String JNP_INTERFACES = "org.jboss.naming:org.jnp.interfaces"; public static final String INITIAL_CONTEXT_FACTORY = "org.jnp.interfaces.NamingContextFactory"; private static...

JMS Translation Bundle does not extract keys from controllers in Symfony2 - getTranslationMessages()

symfony2,internationalization,jms,translation
I am using JMS Translation Bundle in my Symfony 2 project. All translations in the twig files are working great. If I write new keys that need to be translated and run the extract command from command line they get extracted and I can then set appropriate values. My question...

MQ connection throwing null pointer during context.lookup in tomcat

jms,jndi,spring-jms,initial-context
I am trying to connect to MQ using JNDI lookup defined in context.xml of tomcat. While starting the application, i am getting a NamingException and a NullPointer in FFDC. Below is what logged. I am not able to make out what is wrong. Any indication on how to debug this...

ActiveMQ http connection error

java,http,jms,activemq,producer
I am trying to connect my java client application to ActiveMQ over http, but keep getting an error: (complete error at the bottom) javax.jms.JMSException: Could not post command: ProducerInfo No such field org.apache.activemq.command.ProducerInfo.sentCount Also, there is connection to ActiveMQ, because the server also produces an error: (complete error at the...

How i can get list with names of all queues in remote websphere application server?

java,queue,jms,websphere,ibm
I connect to remote was with AdminClient and get list of queues with some code: ... AdminClient client = new AdminClientFactory.createAdminClient(props); Set<ObjectName> s = client.queryNames(new ObjectName("WebSphere:*"),null); if (!s.isEmpty()){ Iterator i = s.iterator(); while (i.hasNext){ ObjectName on = i.next(); String type = on.getKeyProperty("type"); if ("SIBQueuePoint".eqquals(type)){ System.out.println(on.getKeyProperty("name");) } } } This list...

Durable subscription with Qpid JMS client and RabbitMQ

jms,rabbitmq,qpid
I have problems creating a durable subscription to a topic in RabbitMQ using the Qpid JMS client. I tried the following: session.createDurableSubscriber( topic, "name" ); but I get a JMSAMQException with the message "Queue bound query failed: Woken up due to class javax.jms.JMSException" Does anyone know the correct way to...

Sending Message to QueueChannel

spring,jms,spring-integration
My knowledge of JMS is extremely weak so please bear with me. I am trying to send a simple message to a Queue Message Channel. @Autowired private MessageChannel myChannel = null; @Test public void testRecieveMethod() { Message m = ((QueueChannel)myChannel).receive(); System.out.println("HELLO"); } The program hangs like its supposed to but...

JMS Message Selector does not work

java,jms,activemq
I have a requirement to filter message based on the Message selector but it seems the consumer with messageSelector is not filtering any message. I have written below code ActiveMQUtil import org.apache.activemq.ActiveMQConnectionFactory; import javax.jms.*; public class ActiveMQUtil { private ConnectionFactory connectionFactory = null; private Connection connection =null; private Session session...

Does it make a sens to use JMS without Message orineted middleware?

java,jms
I'm new to JMS and now trying to integrate it with my applications. I've decided to use apachemq jars at the client side. So, if I avoid the communication through the message broker ApacheMQ and communicate between the parts of the application directly, will it make a sense? Is the...

Close JMS session and connection after message received

java,jms
I have a stateful session bean where I send and receive JMS messages. All the connection setup is handled manually, so the bean is holding instances of javax.jms.connection and javax.jms.session. The bean also implements MessageListener to be able receive messages. Now, when I send a message, I create a temporary...

SLF4J Linkage Error

java,jms,activemq,slf4j,websphere-8
I have configured JMS Provide in WebSphere Application Server that will use ActiveMQ. For sending message WebSphere needs "activemq-all-5.9.1.jar" in classpath so I added it. This "activemq-all" contains slf4j classes in it. Now my application contains "slf4j-api-1.7.5.jar". When I start WebSphere it gives Caused by: java.lang.LinkageError: org.slf4j.LoggerFactory at java.lang.ClassLoader.defineClassImpl(Native Method)...

JMS Broker receives the message as null

jms,activemq,broker
I have a C++ component which passes message to JMS broker via tcp using ActiveMQ. My broker is written in JAVA. I want these two to communicate; to C++ component send messages to the JAVA broker. On C++ side what I am doing is creating a message (using protocol buffer),...

Intercept incoming JMS messages to ActiveMQ, reject/approve based on rules

java,jms,apache-camel,activemq
Is there a feature in ActiveMQ, perhaps with Camel, to do the following? intercept incoming message at the broker validate headers and/or body based on arbitrary rules throw exception to sender if message not validated, or.. reroute invalid messages to 'rejection' queue ...

Understanding the JMS communication schema by example

java,jms
Going through the JMS Oracle tutorial, I faced the following schema: There was also metnioned that the JMS application basically composed of the parts: JMS provider JMS clients Messages Administered objects I'd like to understand that communication schema by a concrete example. Assume that we have two web applications running...

JEE7 + WildFly (HornetQ) - Pause queue from application

java,jms,wildfly-8,java-ee-7,hornetq
We are using WildFly + HornetQ as our application server and JMS message queue, and have the requirement to be able to pause/resume queues from the application. Is this possible?

What does vm prefix mean in the address line?

java,jms,activemq
I'm going through the Apache ActiveMQ example and faced the vm prefix as follows: ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://localhost"); What does that mean? By the way, when I connect to the mesasge broker I basically use an address like tcp://localhost:61616....

Connecting remote JBoss-eap-6.2 to pass message in java

java,jboss,jms,hornetq
Code runs without any problem up to creating connection factory but it cannot create topic connection. When creating topic connection it throws following exception.(My code is for creating publisher and subscriber) Here is the terminal output I received, Jun 03, 2015 10:51:55 AM org.xnio.Xnio <clinit> INFO: XNIO Version 3.0.7.GA-redhat-1 Jun...

How exactly works this configuration that definies the JMS infrastracture into a Spring application?

java,spring,spring-mvc,jms,spring-jms
I am doing some exercises on JMS in Spring and I have some doubt. Into the solution of an exercise I have this configuration class named JmsInfrastructureConfig: package config; import javax.jms.ConnectionFactory; import javax.jms.Destination; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.command.ActiveMQQueue; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class JmsInfrastructureConfig { /** * Create a...

Getting Message Count of a JMS queue Programmatically using any API

java,jboss,jms
I have created a queue in JBoss 5 with persistence. Messages are consumed asynchronously so what I want is the count of messages already in the queue every time a server is restarted. I can see the message count on jmx-console (Screenshot Attached). This message count i want in my...

This method is not applicable inside the app server when trying to set a listener for a JMS queue

java,jms
I am trying JMS 2.0 so I can decide if it is worth applying in my project. I could successfully create a send/receive application. Now I would like to have listeners that will receive the message as soon as it is available on the queue (my final goal is to...

How exactly works JMS queue (point to point message)?

java,spring,java-ee,jms,spring-jms
I am studying for the Spring Core certification and I have some doubt about how JMS works and about how Spring handle it. So I know that the JMS Core Components are: Message Destination Connection Session MessageProducer MessageConsumer From what I have understand a Message is what is send and...

Timeouts in camel

jms,apache-camel
I'm using the split-aggregate functionality in Camel to split some work up amongst some JMS clients. The Camel route is defined (using groovy) as follows: from("vm:getQuotes") .split(new MethodCallExpression("requestSplitter", "splitAmongstBots"), new ArrayListAggregationStrategy()) .to("jms:queue:quoteRequests?requestTimeout=${responseTimeout}s") .unmarshal().json(JsonLibrary.Jackson) .end() The JMS clients can take between approx 15 and 90 seconds to process the tasks. I'm...

Camel and ActiveMQ

java,jms,apache-camel,activemq
I´m very new on the camel world, that is why I´m asking for your help. Let me tell you what I would like to do: I have this basic Camel standalone project: package maventest1; public class JmsToSql { private Main main; public static void main(String[] args) throws Exception { JmsToSql...

Using topics but not all the consumers take the message

spring,jms,activemq,spring-jms,jmstemplate
I want to create a sender to generate message and the send it to all consumers. I am using topic, but something is wrong, if for example I have 3 consumers, only one takes the message in a random way. I don´t know what is wrog. Here is my server...

Trigger Monitor in JMS Provider like MQ Series

jms,qpid,jboss-messaging,openjms,sonicmq
In Websphere MQ I can configure a Queue to Trigger an Application when a message arrives. In that way I can have an Application that starts only if needs and I don't have to manage one daemon that wait for message in that queue. More information about here Are There...

Implementing asynchronous publish subscribe topic in tibco ems

asynchronous,jms,publish-subscribe,tibco-ems,jms-topic
my scenario is that me as a movie distributor, need to update my clients on new movies, I publish this information on a topic with durable subscribers and clients who want to buy the movie will express their interest. However, this is where things go south, my implementation of the...

Apache Kafka is JMS api?

jms,kafka
Apache Kafka is not a JMS implementation? I using JMS+AMQ in my application and emigration to Apache Kafka, i have to change all JMS codes?...

JMS - How to correctly implement message receiver with explicit acknowledge?

java,jms
The JMS API is driving me to the point of a mental breakdown.. What is the correct way to poll messages of a jms queue and explicitly acknowledge that each message has been processed correctly? Should I create a "transacted session" and which acknowledge mode is the correct one in...

Spring Batch : Remote Chunking & Partitioning without using jms

jms,rmi,spring-batch,httpinvoker
I am new to spring batch. I want to run spring batch jobs using remote chunking & partitioning technique on multiple servers without using jms. I want to use HTTP Invoker or RMI rather than using jms. But, All examples of remote chunking & partitioning use jms. I can't find...

Creating JMS topic publisher returns 2035 unauthorized in WMQ

jms,websphere-mq,jms-topic
I am having a ongoing problem trying to create a topic publisher from seemingly simple java code. My WMQ is administered separately in the company so I have no direct control of it. I try to connect to the topic by creating a TopicConnection, then a TopicSession and then a...

Sending JMS messages in WSO2 without specifying all JMS parameters in proxy definition

oracle,jms,wso2
I got a WSO2 example to work with Oracle based on http://wso2.com/library/tutorials/2011/11/configuring-wso2-esb-with-oracle-as-messaging-media/. My question is: rather than having to specify all the JMS connection parameters in the proxy, is it possible to define the transport sender in axis2.xml and refer to it in the proxy, similar to how you do...

java.lang.NoClassDefFoundError: Files\Apache on launching ActiveMQ

java,apache,exception,jms,activemq
I've downloaded Apache ActiveMQ 5.9.0 and I'm trying to launch it. Following, the command I've typed and the output: c:\Program Files\Apache Software Foundation\apache-activemq-5.9.0>bin\activemq java.lang.NoClassDefFoundError: Files\Apache Caused by: java.lang.ClassNotFoundException: Files\Apache at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at...

Returning string from jms

java,jms,listener,activemq
I am writing a stand alone main method which invokes a producer (to push data into a queue), and then invokes a consumer which keeps listening to the topic. I have overridden the onMessage and I am able to get the message from the queue, but I am not able...

Cannot concurrently consume from ActiveMQ embedded broker

java,jms,activemq
I'm looking for a way to publish 10 messages to an ActiveMQ embedded broker and, at the same VM, concurrently consume they using JMS API. The code below has some kind of race, because sometimes it consumes 2, 4, 8 messages in parallel, and hangs until timeout at the latch.await...

How can I ask a JMS server to resend the message when an exception occurs in a JMS listener defined with the @JmsListener annotation?

annotations,jms,listener,spring-boot
I have been writing a JMS listener in a Springboot application. I used two ways: 1) Defines a a bean which is SimpleMessageListenerContainer like this: @Bean SimpleMessageListenerContainer getMyMessageListenerContainer(ConnectionFactory connectionFactory) { MessageListenerAdapter messageListener = new MessageListenerAdapter(myService); messageListener.setDefaultListenerMethod("myMethodListener"); SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(); container.setMessageListener(messageListener);...

How to use log4j2 JMSAppender with ActiveMQ

java,jms,activemq,jndi,log4j2
I am struggling to write a simple POC program that logs messages to a Queue. All tutorials and Q&As I find (here and here) use log4j version 1.2 and they put messages onto a Topic and not onto a queue. My requirement is to log to a queue. I followed...

JmsTemplate and CachingConnectionFactory

jboss,jms,spring-jms,jmstemplate
I'm finding some difficulties in trying to reduce the connection and session creation when sending messages to a Jboss Queue. <bean name="jbmTemplate-${jbmQueue}" class="org.springframework.jms.core.JmsTemplate" lazy-init="true"> <property name="sessionTransacted" value="true" /> <!-- connection factory --> <property name="connectionFactory"> <ref bean="jbmCachingConnectionFactory"/> </property> <property name="pubSubDomain"> <value>false</value> </property> <property...

Cross language support in ActiveMQ

java,python,jms,activemq,stomp
I am working with several different services which have been written in Python and Java. I have now come to the point where I need to have these services communicate with each other and ActiveMQ seems to be a sensible choice. However, I am not sure I quite follow the...

Setting time-to-live to messages in Spring Integration

spring,jms,spring-integration,messaging,qpid
i need to set a time-to-live to my messages. I tried the following example, but the time-to-live will be ignored. :/ context.xml <int:channel id="publishChannel"/> <int-jms:outbound-channel-adapter channel="publishChannel" destination="defaultDestination" time-to-live="5000" pub-sub-domain="false" /> Publisher import org.springframework.integration.annotation.Publisher; import org.springframework.messaging.Message; import org.springframework.messaging.MessageChannel; import org.springframework.stereotype.Service;...

Not able to send message to Solace JMS Queue

java,jms,jms-topic,solace-mq
I need to push message to Solace JMS queue Webpshere but I am getting below error during send message. I have also increase message listener size but not solved problem. Error: 503: Spool Over Quota. Message VPN limit exceeded Caused by: com.solacesystems.jcsmp.JCSMPErrorResponseException: 503: Spool Over Quota. Message VPN limit exceeded...

Websphere MQ classes needed in Websphere Application Server

java,java-ee,jms,websphere,websphere-mq
So I have a JMS application deployed on a Webpshere Application Server, this application try to connect to the queue directy using a com.ibm.mq.jms.MQConnectionFactory and I wonder if I should include Websphere MQ jars in my application or should they be provided by Websphere Application Server. My application is currenty...

OpenCSV + JMS/MDB behavior + performance issue

java,glassfish,jms,message-driven-bean,opencsv
I have an web application, that runs under Glassfish 4.1, that contains a couple of features that require JMS/MDB. In particular I am having problems regarding the generation of a report using JMS/MDB, that is, obtain data from a table and dump them in a file. This is what happens,...

Difference between AUTO_ACKNOWLEDGEMENT mode with and without Spring JMS

jms,messaging,spring-jms
I am trying to understand how acknowledgement modes work in JMS. I was reading this source and it hugely confused me as it was contradicting what Spring's documentation says. Sources saying one thing: From http://www.javaworld.com/article/2074123/java-web-development/transaction-and-redelivery-in-jms.html A message is automatically acknowledged when it successfully returns from the receive() method. If the...

risk of depending software solution to activemq

java,jms,activemq,software-distribution
I'm implementing a distributed software that have two loosely coupled component and they need to send message in a reliable and scalable way. I find activemq as a implementation of jms standard and do some research and sample implementation. my two key requirements is : scalability reliability (not losing messages)...

Automatically restore connection to the main queue when server is up again

java,jms,apache-camel,websphere-mq
I have a master MQ and a slave MQ. If the master MQ goes down, can I send the messages through the slave MQ using a message driven bean ? Also after my master MQ is up again can I reconnect the line automatically without restarting the JVM ?

Examples of applications that use Java Message Service

java,java-ee,jms,mom
I have read some tutorials and articles about JMS, but none of these give an example of an application that can use this API. I was wondering if someone can give an example of a real world use of Java Message Service. Thanks

How to define max queue size using Spring-JMS

java,spring,jms,activemq,spring-jms
I followed Spring-boot article to define local activemq: https://spring.io/guides/gs/messaging-jms/ I would like to set the queue size(for X times). so when producer try to enqueue new times it will get expcetion in case the size is on it's limit How could I define that? thank you....

Valid “protocols” for HornetQ

java,jboss,jms,hornetq
I have some code like this for connecting to HornetQ. Properties properties = new Properties(); properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory"); properties.put(Context.PROVIDER_URL, "remote://127.0.0.1:4447"); properties.put(Context.SECURITY_PRINCIPAL, "user"); properties.put(Context.SECURITY_CREDENTIALS, "pwd"); ConnectionFactory connectionFactory = null; Destination destination = null; try { Context context = new InitialContext(properties); I inherited this, and am trying to get a...

Filter / drop duplicate messages from ActiveMQ queue based on custom properties

jms,apache-camel,activemq
Problem When my web application updates an item in the database, it sends a message containing the item ID via Camel onto an ActiveMQ queue, the consumer of which will get an external service (Solr) updated. The external service reads from the database independently. What I want is that if...

Setting up ActiveMQ bridge to connect to different implementations of MOM

jms,activemq,websphere-mq,tibco-ems
I would like to deploy ActiveMQ in order to connect and communicate with other MOM implementations of jms such as WebsphereMQ, Tibco EMS, Oracle WebLogic JMS etc. As far as I have researched online this seems to be possible by building a so-called bridge on top of activemq that will...

ActiveMQ - Security exception when creating new topic session

java,java-ee,jms,activemq
I'm learning jms and found a sample Chat application but when i try running it, I get a security exception. It seems i need to pass in username and password when creating a new topic session, but the tutorial does not mention this. Chat app code : package ch02.chat; import...

How to maintain order of messages being processed in a mule flow from VM to JMS using one-way message exchange pattern?

jms,mule,virtual-machine,esb,mule-studio
I am using mulesoft ESB with Anypoint studio for a project. In one of my flows I am using one-way message exchange pattern to dispatch from VM (persistence file store VM connector) to JMS, both xa transaction enabled to avoid losing messages. Consider a scenario where we send a message...

Webapp hangs when Active MQ broker is running

spring,jms,activemq,maven-jetty-plugin,jstack
I got a strange problem with my spring webapp (running on local jetty) which connects to a locally running ActiveMQ broker for JMS functionality. As soon as I start the broker the applications becomes incredibly slow, e.g. the startup of the ApplicationContext with active broker takes forever (i.e. > 10mins,...

Connect Activemq using iiop

java,spring,jms,activemq
I am successfully sending/receiving messages to ActiveMQ using TCP brokerURL as: tcp://localhost:61616 How can I sending/receiving messages to ActiveMQ using IIOP?...

JMS message receiver filtering by message text

java,java-ee,jms
I am working on migration project. I want to set filters on jms message text. Here JMS messages text content has xml messages. Are there any methods available in jms to add filter on xpath or some text content, or any tools which provide this kind of functionality?

Confused with Apache Camel and ActiveMQ

jms,apache-camel,activemq
I'm pretty much new to Apache Camel & ActiveMQ and finding it really difficult and confusing to grasp the concept of the same.Infact, I'm new to this whole concept of JMS. I really don't understand how Apache Camel is different from ActiveMQ, because as per my understanding, both serves the...

JMS session thread implications

java,multithreading,jms
What does it mean that : A Session object is a single-threaded context for producing and consuming messages Why does Session extends Runnable? Does that imply that when we create a new session object, a new application level thread is always started? Please I need help on understanding this....

Message selector options JMSCorrelationID or simple string as a JMS property

jms,activemq
Which message selector option is good ? JMSCorrelationID or simple string as a JMS property to selectively fetch messages from queue ? I believe, in term of performance they are same. Producer side using string property: message = session.CreateTextMessage(msg); message.setString("myfilter", "abc"); producer.sent(message); Producer side using JMSCorrelation ID : message =...

how to create JMS queues in run-time using Spring JMS support?

java,spring,jms,spring-jms
I need to dynamically create JMS queues during runtime. Is it possible to do this with the Spring JMS support (JmsTemplate?)? and how? code examples or references would be greatly appreciated. Update: It turns out that it is not possible to create physical destinations through the JMS API, so I...

How to persist a queue which contains Java Message in Mule ESB?

java,jms,mule,activemq,esb
I am using JMS endpoints and Apache ActiveMQ in my Mule application (I have followed a tutorial and not sure if i am doing the right thing relying on JMS as endpoints) <jms:activemq-connector name="jms-connector" brokerURL="${BrokerURL}" disableTemporaryReplyToDestinations="true" specification="1.1"/> <jms:endpoint connector-ref="jms-connector" exchange-pattern="one-way" name="UnsortedOrders" queue="UnsortedOrders"/> <jms:endpoint connector-ref="jms-connector" exchange-pattern="one-way" name="DestinationEMC"...

JMS QueueConnectionFactory vs ConnectionFactory

java,jms,jndi,mq
My question is about the use of the following 2 factories: ConnectionFactory QueueConnectionFactory At the moment I just use a ConnectionFactory to initialize everything: Connection conn = factory.createConnection(user, pw); Session session = conn.createSession() Destination dest = session.createQueue('xyz') ... If I understand correctly, the QueueConnectionFactory works pretty much the same way....

JMS selector strange behaviour

java,queue,jms,selector
In JMS consider the following pseudo-code: Sender: QueueSender qs = session.createSender(queue); int i = 0; while(i < 10) { TextMessage msg = session.createTextMessage(); msg.setText(""+i); msg.setIntProperty("value", i); qs.send(msg); i++; } Receiver: String sel = "value >2"; QueueReceiver qr = session.createReceiver(q,sel); while(true) { TextMessage tm = (TextMessage) qr.receive(); System.out.println(tm.getText); } I would...

Concurrent message consumption in ActiveMQ

java,jms,activemq,message-queue,messaging
I use a ActiveMQServer as a broker. Server.java import java.util.HashMap; import java.util.HashSet; import java.util.Map; import org.apache.activemq.api.core.TransportConfiguration; import org.apache.activemq.core.config.Configuration; import org.apache.activemq.core.config.impl.ConfigurationImpl; import org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory; import org.apache.activemq.core.server.ActiveMQServer; import org.apache.activemq.core.server.ActiveMQServers; public class Server { public static void...

How to create a subscription on the fly in a IBM MQ cluster?

java,jms,ibm,websphere-mq
When i use this code as subscriber: MQTopic QMsSubscription = qm.accessTopic("qmstop", "", CMQC.MQTOPIC_OPEN_AS_SUBSCRIPTION, CMQC.MQSO_CREATE); MQMessage recvQMsMsg = new MQMessage(); MQGetMessageOptions gmo = new MQGetMessageOptions(); gmo.options = MQConstants.MQGMO_WAIT; gmo.waitInterval = MQConstants.MQWI_UNLIMITED; QMsSubscription.get(recvQMsMsg, gmo); and this code for publisher: MQTopic QMsPublisher = qm.accessTopic("qmstop", "", CMQC.MQTOPIC_OPEN_AS_PUBLICATION, CMQC.MQOO_OUTPUT); MQMessage sendQMsMsg = new MQMessage();...

Roll back exception strategy for Mule request response VM

exception,jms,mule,rollback
I am using mule request response VM and need the rollback messages to be reprocessed by VM in case of some exceptions, say connection issues. However, the rollback exception strategy does not appear to work when I use exchange pattern as request response for VM. The reason I used request...

Deploy JMS Query using Arquillian

maven,jms,jboss-arquillian
I'm using arquilian to test a JMS query. I've seen that i'm able to deploy a descriptor using the Descriptors class, like below: @Deployment public static Descriptor create() { return Descriptors.create(HornetQDescriptor.class); } Ok, but I can't find the HornetQDescriptor class anywhere! I'm using Arquillian 1.1.7.Final, with ShrinkWrap Desriptors 2.0.0-Alpha-7 and...

How to set Content-Type header for JMS message

jms,websphere-mq,mq
We have a Java application that sends JMS message via IBM WebSphere MQ. The consumer application requires the message content type to be set to "application/json". How can I go about doing it? I've checked through a few references and it seems I can set extra header via method "setStringProperty(headerKey,...

DMLC message consumption and acknowledgement

spring,jms,activemq,spring-jms,message-listener
This is a follow up question for Difference between AUTO_ACKNOWLEDGEMENT mode with and without Spring JMS. I am using DMLC and my concurrent consumers count is 1. The prefetch limit is > 1. I received a message and it is acknowledged before listener is executed. So, while the listener is...

Spring-boot app displaying JMS messages on WebPage via WebSocket

websocket,jms,spring-boot,stomp,sockjs
I have an urgent need for a simple web-app in spring-boot that listens for messages on a JMS queue and when arriving it should appear on a webpage via WebSocket. I need a solution for this very soon in a demonstration. I have searched for examples and found several individual;...

Publisher should wait till broker is available

spring,jms,spring-integration,spring-jms
I have a simple publisher, which sends messages to a queue. <int:channel id="publishChannel"/> <int-jms:outbound-channel-adapter channel="publishChannel" destination="testQueue" session-transacted="true"/> @Publisher(channel = "publishChannel") public String sendMessage (String text) { return text; } If the broker crashes, the publisher throws an MessageHandlingException. Is it possible to block the publisher, till the broker is available...

WSO2 Message Broker not receiving message

jms,wso2,wso2esb,messagebroker
i followed the official documentation dealing with the integration between WSO2 ESB and WSO2 MB. https://docs.wso2.com/display/MB210/Integrating+WSO2+ESB On my WSO2 ESB 8.1.0 i wrote a simple proxy like this: <?xml version="1.0" encoding="UTF-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse" name="jobReplicaFeed" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"> <target> <inSequence> <log level="full"/> <send> <endpoint key="ReplicaFeedEndpoint"/> </send>...

PooledConnectionFactory in endless reconnect loop

java,jms,activemq
piece of code below factory = new PooledConnectionFactory(brokerURL); connection = factory.createConnection("", ""); connection.start(); Broker URL is a valid host, but the port is not opened. After starting it goes into an infinite reconnection loop [junit] 00:28:54,851 WARN FailoverTransport:1109 - Failed to connect to [SOME_URL] after: 10 attempt(s) continuing to retry....

Remote JMS communication works, EJB communication fails

ejb,jms,wildfly,java-ee-7
I'm currently introducing myself into Java EE, especially into how to use EJB and JMS. The Issue in a Nutshell I have a local client and a remote server in the internet. JMS communication works fine, EJB communication doesn't. Either communication succeeds in my local network. The Issue in More...

messagebased RPC with topic

spring,jms,spring-integration,messaging,spring-jms
A simple message-based RPC is very easy to create. The server side exports the service, the client side uses a proxy. What is the best way, to make the same thing with multiple repliers? I want to send a request from a client. Then the client waits while all (maybe...

Error while setting targetConnectionFactory in UserCredentialsConnectionFactoryAdapter Spring 4

java,spring,jms,spring-boot,spring-jms
We are receiving a compilation error in the following code, while trying to set the targetConnectionFactory. According to the example given in Spring 4 documentation for UserCredentialsConnectionFactoryAdapter, the setTargetConnectionFactory() method takes the object of JndiObjectFactoryBean as an argument. But, looks like the JndiObjectFactoryBean hasn't implemented the 'ConnectionFactory' interface, which is...

ActiveMQ and prefetch limit

jms,activemq,spring-jms
I want to understand how ApacheMQ's prefetch limit works. Are all the messages sent in one burst? What if there are concurrent consumers, what happens then? What is the difference between prefetch limit of 0 and 1?...

Error in setExceptionListener in sending message via JmsTemplate to ActivemQ (as external broker of Jboss-eap)

spring,jms,activemq,spring-jms,jboss-eap-6
Based on this article, I've connected Jboss eap 6.2 to an external ActivemQ 5.9.0. For sending/receiving message i'm using JmsTemplate and DefaultMessageListenerContainer in spring-jms 4.1.1. Receiving message is working fine, but in sending message i get this error: 11:33:37,059 ERROR [stderr] java.lang.reflect.InvocationTargetException 11:33:37,060 ERROR [stderr] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 11:33:37,060 ERROR...

JMS Prefetch + Cached Consumers + Stuck Messages

java,spring,jms,activemq,spring-jms
I am trying to get JMS Consumers to work towards an ActiveMQ server however I am running into some issues which solution seem to just cause more problems. I am using Spring's DMLC (cacheLeve set to CACHE_CONNECTION) together with a CachingConnectionFactory (cachingConsumers set to true) wrapping Activemq's own ConnectionFactory in...

How to Produce from MQTT and consume as MQTT and JMS in ActiveMQ

jms,activemq,mqtt
I have a setup where messages are produced as MQTT to ActiveMQ. I have two consumers one as JMS and another MQTT. When I am publishing message as JMS Message to the topic "foo", I am receiving the messages at both JMS and MQTT consumers, but when I am publishing...

jms selector expression in Mule is not working

jms,mule,mule-studio
<flow name="readqueueFlow1" doc:name="readqueueFlow1" > <jms:inbound-endpoint queue="MyTestQueue" connector-ref="Active_MQ-Priority" doc:name="JMS"> <jms:selector expression="JMSCorrelationID=’353’" /> </jms:inbound-endpoint> </flow> Its working but when i try to use the below one its not deploying <!-- When we don't provide single quote it is failing in deployment --> <jms:selector expression="JMSCorrelationID='#[flowVars.reqId]'" /> <!-- Payload contains reqId, when we provide...

How to: Implement a BatchMessageListenerContainer for bulk consuming a JMS queue

performance,jms,spring-integration,bulk,consuming
I recently faced the need for a JMS consumer in Spring Integration - capable of consuming burst of high volume without stressing my target Oracle database with too many commits. The DefaultMessageListenerContainer does not seem to support anything but message by message transactions. I googled for solutions and found a...

Notify ActiveMQ producer if consumer on the destination is down

spring,jms,activemq,spring-jms
I am using ActiveMQ messaging broker and I have a requirement where the producer application would want to know if the consumer application consuming on the particular destination is up or not? How can I achieve this? Thanks!...

WSO2 ESB and JMS or AMQP custom properties

routing,jms,wso2,amqp
Is it possible to read custom headers/property values from inbound JMS and/or AMQP messages ? How is this accomplished ? We currently use headers for routing purposes in Apache Camel so I need to do the same thing with WSO2 ESB. Thank you.

How to handle transaction rollback with JMS and JPA in a Java EE environment?

java,jpa,transactions,jms,weblogic
The default rollback behavior for a CMT MDB is to return the message to the destination so it may be processed again. Is it possible to avoid redelivering a message handled by a managed MDB even if the the transaction is rolled back? (Or maybe configure the acknowledgement behavior handled...