activemq

Why is jmsTemplate always null? Using spring and Apache ActiveMQ [duplicate]

限于喜欢 提交于 2019-12-10 19:36:04
问题 This question already has answers here : Why is my Spring @Autowired field null? (16 answers) Closed 4 years ago . Im very new to Spring and JMS. Ive been trying to come up with an implementation that involves activemq and Spring as follows. spring-context.xml <bean id="sampleApacheConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory" lazy-init="true"> <property name="brokerURL" value="tcp://localhost:61616"/> <property name="userName" value=“kodeseeker"/> <property name=

ActiveMQ gives: “Could not connect to broker URL: tcp://localhost:61616” after around 10 000 messages

泪湿孤枕 提交于 2019-12-10 19:33:46
问题 ActiveMQ gives: "javax.jms.JMSException: Could not connect to broker URL: tcp://localhost:61616. Reason: java.net.BindException: Address already in use: connect" after around 10 000 messages Then after a some time (around 1-5 seconds) start to get messages with no issue. I'm using Spring Boot 2.0.4 with very basic configuration: spring.activemq.broker-url=tcp://localhost:61616 spring.activemq.user=admin spring.activemq.password=admin spring.activemq.packages.trust-all=true I used JmsTemplate

ActiveMQ How to handle closed session

試著忘記壹切 提交于 2019-12-10 19:28:05
问题 I am using ActiveMQ to enqueue email messages, the consumer reads the queue and sends out emails. At startup, I register a producer and cache it forever. PooledConnectionFactory factory = new PooledConnectionFactory(new ActiveMQConnectionFactory(jmsBrokerUserName, jmsBrokerPassword, activeMQBrokerURL)); Connection connection = factory.createConnection(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); Destination destination = session.createQueue(queueName);

Embed ActiveMQ into JBoss 7

空扰寡人 提交于 2019-12-10 19:01:34
问题 We used to use ActiveMQ 5.5 as an embedded service in JBoss 5 (via ActiveMQ Resource Adapter), so that the JMS broker has been always running on the localhost on the the same JVM as the client application itself. We followed this instructions to configure it - http://activemq.apache.org/integrating-apache-activemq-with-jboss.html Now I'm trying to do the same for JBoss 7 , but cannot find any clear guide how to do it. Have anybody done this yet? Can you point me to the guideline with the

How to create/preconfigure durable subscriber(s) in activemq.xml so that these subscriptions are ready upon ActiveMQ starts up?

天大地大妈咪最大 提交于 2019-12-10 18:40:50
问题 How to create/preconfigure durable subscriber(s) in activemq.xml so that these subscriptions are ready upon ActiveMQ comes up? As if subscribers are in the offline state. We're expecting a fixed (yet configurable) number of known subscribers. Wanna buffer all msgs sent by the publisher starting day 1, in case not all subscribers are up. Not sure if this is a common scenario but thanks in advance for the help. 回答1: This is a really common use case. What you should actually be looking at is

In WSO2 ESB 4.7.0 can we do JMS rollback in receiving sequence?

自闭症网瘾萝莉.ら 提交于 2019-12-10 17:56:32
问题 I have configured Apache ActiveMQ with transaction and CLIENT_ACKNOWLEDGE in WSO2 ESB 4.7.0. The axis2.xml config is : <parameter name="transport.jms.SessionTransacted">true</parameter> <parameter name="transport.jms.SessionAcknowledgement" locked="true">CLIENT_ACKNOWLEDGE</parameter> I have a simple passthrough proxy with jms transport which passes the messages in the JMS queue to a jax-rs service. The proxy code is : <?xml version="1.0" encoding="UTF-8"?> <proxy xmlns="http://ws.apache.org

Batch consuming of JMS messages

ⅰ亾dé卋堺 提交于 2019-12-10 17:51:21
问题 The MessageListener interface only defines a method onMessage that receives a single Message as argument. I'm looking for a way to get multiple Message s from a queue so that I can process the batch and then acknowledge all the Message s in the batch. Is there such feature in JMS world? If no, is it supported by ActiveMQ as an extension? Thanks, Mickael 回答1: This is explained in JMS 1.1 spec section 4.5.1 Synchronous Delivery : A client can request the next message from a MessageConsumer

ActiveMQ JNDI Lookup Issues

▼魔方 西西 提交于 2019-12-10 17:39:12
问题 Trying to get ActiveMQ with JNDI running following (http://activemq.apache.org/jndi-support.html) and i have all the required activeMQ jars in my jboss/server/node/lib folder and my jndi.properties looks like: java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory # use the following property to configure the default connector java.naming.provider.url = vm://localhost # use the following property to specify the JNDI name the connection factory # should appear as.

JSONPath expression for checking string in Apache Camel XML

旧时模样 提交于 2019-12-10 17:24:18
问题 Let's say I have a simple json file such as the following { "log": { "host": "blah", "severity": "INFO", "system": "1" } } I'm using Apache Camel, and it's Spring XML to process and route the json file. My routing code looks something like this: <route> <from uri="file:/TESTFOLDER/input"/> <choice> <when> <jsonpath>$.log?(@.severity == 'WARNING')</jsonpath> <to uri="smtp://(smtpinfo...not important)"/> </when> <otherwise> <to uri="file:/TESTFOLDER/output"/> </otherwise> </choice> </route> The

Sending message from HTTP endpoint to JMS

折月煮酒 提交于 2019-12-10 16:00:02
问题 I am trying to have a camel route, which would accept a payload on a http endpoint and then write that payload to a JMS queue. The route that I have so far is below. But an empty message gets delivered to the jms queue. A message gets there, but it has no body. Heres the route: <route > <from uri="jetty:http://0.0.0.0:8050/add/Customer"/> <inOnly uri="jms:queue:Q.Customer" /> </route> Heres the payload that I'm sending into to ' http://0.0.0.0:8050/add/Customer ' endpoint: <Customer xmlns=