activemq

activemq connection pooling

我是研究僧i 提交于 2020-01-04 14:16:30
问题 I am using ActiveMQConnectionFactory to create connection. i am creating only one connection. I am having many threads running under this single connection creating session and producer (each thread would have its own session and producer). My question is: If i am using only one connection then should I use connection pooling (PooledConnectionFactory) or should stick with ActiveMQConnectionFactory. Can anyone please also explain difference between these two (probably in basic terms as I am

How to kill consumers in activemq

一曲冷凌霜 提交于 2020-01-04 09:32:52
问题 I am trying to get rid of all of the "Number of Consumers" in a certain queue. Whenever I purge/delete the queue, the number of consumers still remain if I ever create that queue with the same name again. Even with 0 pending messages, there are still 6 consumers. My problem may have stemmed in my java code while not closing the session or connection. I have tried both restarting and reinstalling the server. Here is my producer code: private static String url = ActiveMQConnection.DEFAULT

How to kill consumers in activemq

半城伤御伤魂 提交于 2020-01-04 09:31:42
问题 I am trying to get rid of all of the "Number of Consumers" in a certain queue. Whenever I purge/delete the queue, the number of consumers still remain if I ever create that queue with the same name again. Even with 0 pending messages, there are still 6 consumers. My problem may have stemmed in my java code while not closing the session or connection. I have tried both restarting and reinstalling the server. Here is my producer code: private static String url = ActiveMQConnection.DEFAULT

Apache Camel - Build both from and to endpoints dynamically

霸气de小男生 提交于 2020-01-04 07:11:50
问题 I have a camel route which processes a message from a process queue and sends it to upload queue . from("activemq:queue:process" ).routeId("activemq_processqueue") .process(exchange -> { SomeImpl impl = new SomeImpl(); impl.process(exchange); }) .to(ExchangePattern.InOnly, "activemq:queue:upload"); In impl.process I am populating an Id and destination server path . Now I need to define a new route which consumes messages from upload queue ,and copy a local folder (based on Id generated in

Apache Camel - Build both from and to endpoints dynamically

谁说我不能喝 提交于 2020-01-04 07:11:08
问题 I have a camel route which processes a message from a process queue and sends it to upload queue . from("activemq:queue:process" ).routeId("activemq_processqueue") .process(exchange -> { SomeImpl impl = new SomeImpl(); impl.process(exchange); }) .to(ExchangePattern.InOnly, "activemq:queue:upload"); In impl.process I am populating an Id and destination server path . Now I need to define a new route which consumes messages from upload queue ,and copy a local folder (based on Id generated in

Can my sql server send messages to activemq server without any java app in between

强颜欢笑 提交于 2020-01-04 04:33:07
问题 We are using Sql 2012 database server. When ever the db modifies we want it to trigger a message that can be stored in a queue using activemq. We are not sure how can we code to trigger a db so that it sends a message. Can we directly make the message generated from db to get queued in activemq without any java interface in between. I would want to know whether we can achieve this or not. 3.Are there any other ways to set up a communication between sql server and activemq say between database

Communicating between PHP and Java using ActiveMQ/Stomp

跟風遠走 提交于 2020-01-04 02:42:08
问题 Background I have two services that need to communicate with each other over a message queue. One is a legacy service written in PHP and the other is in Java. Sooner than later, the PHP service will be rewritten in Java. The current way they communicate with each other is to write to a shared database, which the other service polls. This is what I'm trying to get away from and replace with a message queue. Problem The communication I'm working on right now is from the PHP service to the Java

activeMQ类别和流程

我只是一个虾纸丫 提交于 2020-01-03 20:37:19
Point-to-Point (点对点)消息模式开发流程 : 1、生产者(producer)开发流程: 1.1 创建Connection: 根据url,user和password创建一个jms Connection。 1.2 创建Session: 在connection的基础上创建一个session,同时设置是否支持事务和ACKNOWLEDGE标识。 1.3 创建Destination对象: 需指定其对应的主题(subject)名称,producer和consumer将根据subject来发送/接收对应的消息。 1.4 创建MessageProducer: 根据Destination创建MessageProducer对象,同时设置其持久模式。 1.5 发送消息到队列(Queue): 封装TextMessage消息,使用MessageProducer的send方法将消息发送出去。 2、消费者(consumer)开发流程: 2.1 实现MessageListener接口: 消费者类必须实现MessageListener接口,然后在onMessage()方法中监听消息的到达并处理。 2.2 创建Connection: 根据url,user和password创建一个jms Connection,如果是durable模式,还需要给connection设置一个clientId。 2.3

ActiveMQ-为什么需要消息中间件?

匆匆过客 提交于 2020-01-03 20:28:27
消息中间件的优势 UNIX的进程间通信就开始运用消息队列技术,一个进程将数据写入某个特定的队列中,其它进程可以读取队列中的数据,从而实现异步通信。对于如今的分布式系统,消息队列已经演变为独立的消息中间件产品,相比于RPC同步通信的方式来说有几个明显的优势: 低耦合,不管是程序还是模块之间,使用消息中间件进行间接通信。 消息的顺序性,消息队列可以保证消息的先进先出。 消息可靠传输,持久化的存储使得消息只有在被消费之后才会删除。 异步通信能力,相对于RPC来说,异步通信使得生产者和消费者得以充分执行自己的逻辑而无需等待。 缓冲能力,消息中间件像是一个巨大的蓄水池,将高峰期大量的请求存储下来慢慢交给后台进行处理,对于秒杀业务来说尤为重要。 但是异步通信也存在程序设计和编程方面的复杂,同时对于实时性要求较高的业务也不能采用异步通信,所以要根据业务具体分析。 J2EE和JEE是什么? J2EE全称是Java to Enterprise Edition,是一套企业级技术规范,包含:JMS Servlet JSP EJB JPA 等。J2EE发展到1.5版本改名为JEE5,所以JEE是J2EE规范的延续。 消息中间件的发展历程 J2EE时代,消息中间件强调企业级特性,比如消息持久化和事务性要求,全部遵循JMS规范。典型的ActiveMQ、HornetQ,后者现在已经发展成ActiveMQ

ActiveMQ学习笔记(17)----Message高级特性(一)

老子叫甜甜 提交于 2020-01-03 20:28:06
1. Messaage Properties   ActiveMQ支持很多消息属性,具体可以参考   http://activemq.apache.org/activemq-message-properties.html   常见得一些属性说明:   1. queue得消息默认是持久化得   2. 消息得优先级默认是4.   3. 消息发送时设置了时间戳。   4. 消息的过期时间默认是永不过期,过期的消息进入DLQ,可以配置DLQ及其处理策略。   5. 如果消息是重发的,将会被标记出来。   6. JMSReplyTo标识响应消息发送到哪个queue.   7. JMSCorelationID标识此消息相关联的消息id,可以用这个标识把多个消息连接起来。   8. JMS同时也记录了消息重发的次数。默认是6次   9. 如果有一组相关联的消息需要处理,可以分组;只需要设置消息组的名字和这个消息的第几个消息。   10. 如果消息中一个事务环境,则TXID将会被设置。   11. 此外ActiveMQ在服务器端额外设置了消息入队和出队的时间戳。   12. ActiveMQ里消息属性的值,不仅可以用基本类型,还可以用List或Map类型 2. Advisory Message   Advisory Message是ActiveMQ自身的系统消息地址