activemq

Cross platform real-time-data

眉间皱痕 提交于 2019-12-11 17:16:29
问题 I am working on designing a new platform for a certain type of application. These applications will mainly exists on both iOS and Android devices. One of the main requirements in these applications is that is syncs real time data and is secure. My thought went directly to using some kind of queuing protocol using sockets. The restrictions on the server is that it would have to be written in either Java or PHP. However, the clients are unrestricted. Like I mentioned, mainly iOS (Objective-C)

Log4j.xml配置日志按级别过滤并将指定级别的日志发送到ActiveMQ

泄露秘密 提交于 2019-12-11 15:48:07
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 在之前的一篇博客《 Spring+Log4j+ActiveMQ实现远程记录日志——实战+分析 》的评论中,有同学提到这种方式应 该要能根据日志级别设置来决定是否发送到mq,不然会大量占用网络资源。于是经过了一番搜索后,实现了这个功能。现在记录在这里。 目标:将debug,info级别的日志输出到本地文件,将warn,error级别的日志输出到ActiveMQ。 说明:本文还是使用之前的两个项目:Product和Logging。 经过一番搜索后,发现log4j还可以按照级别过滤日志,但 过滤只能使用log4j.xml配置 : Filters can be defined at appender level. For example, to filter only certain levels, the LevelRangeFilter can be used like this: <appender name="TRACE" class="org.apache.log4j.ConsoleAppender"> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="[%t] %-5p %c - %m

Spring+Log4j+ActiveMQ实现远程记录日志——实战+分析

筅森魡賤 提交于 2019-12-11 15:45:55
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> ‍ 应用场景 ‍ 随着项目的逐渐扩大,日志的增加也变得更快。 Log4j是常用的日志记录工具, 在有些时候,我们可能需要将Log4j的日志发送到专门用于记录日志的远程服务器,特别是对于稍微大一点的应用。这么做的优点有: 可以集中管理日志 :可以把多台服务器上的日志都发送到一台日志服务器上,方便管理、查看和分析 可以减轻服务器的开销 :日志不在服务器上了,因此服务器有更多可用的磁盘空间 可以提高服务器的性能 :通过异步方式,记录日志时服务器只负责发送消息,不关心日志记录的时间和位置,服务器甚至不关心日志到底有没有记录成功 远程打印日志的原理:项目A需要打印日志,而A调用Log4j来打印日志,Log4j的JMSAppender又给配置的地址(ActiveMQ地址)发送一条JMS消息,此时绑定在Queue上的项目B的监听器发现有消息到来,于是立即唤醒监听器的方法开始输出日志。 本文将使用两个Java项目Product和Logging,其中Product项目就是模拟线上的项目,而Logging项目模拟运行在专用的日志服务器上的项目。说明:本文的例子是在Windows平台下。 ‍ 安装ActiveMQ ‍ 1. 下载: http://activemq.apache.org/download.html 2.

How to set message priority for embedded activeMQ using spring JmsTemplate?

谁说胖子不能爱 提交于 2019-12-11 14:48:43
问题 I am following this guide- https://spring.io/guides/gs/messaging-jms/ I have few messages with higher priority that needs to be sent before any other message. I have already tried following - jmsTemplate.execute(new ProducerCallBack(){ public Object doInJms(Session session,MessageProducer producer){ Message hello1 =session.createTextMessage("Hello1"); producer.send(hello1, DeliveryMode.PERSISTENT,0,0); // <- low priority Message hello2 =session.createTextMessage("Hello2"); producer.send

Apache.NMS.ActiveMQ client hang when connection has been broken

穿精又带淫゛_ 提交于 2019-12-11 14:33:09
问题 Our client connects to cluster with 2 ActiveMQ nodes. Apache.NMS.ActiveMQ library hang when we drop network connection manually between client and cluster. We use Apache.NMS.ActiveMQ with version 1.7.2 and cluster based on ActiveMQ 5.15.3. Connection URI is: failover:(tcp://dd-amq-app01:61616,tcp://dd-amq-app02:61616)?transport.maxReconnectAttempts=0&transport.startupMaxReconnectAttempts=0&transport.useExponentialBackOff=false&transport.maxReconnectDelay=1000&transport.timeout=10000 I expect

Can we prioritize ActiveMQ messages based on message properties or headers?

ぐ巨炮叔叔 提交于 2019-12-11 14:17:29
问题 This is followup question on this I am setting few application specific properties on messages and i want the messages to be prioritized based on those specific property values For example : Message message = session.createTextMessage("hello world!"); message.setStringProperty("myProperty","100"); producer.send(message ) Here I want messages to be prioritize based on value of myProperty . Is this possible? 回答1: ActiveMQ doesn't support prioritizing delivery based on arbitrary message headers

ActiveMQ async statistics receiving

我怕爱的太早我们不能终老 提交于 2019-12-11 14:07:09
问题 I am facing a pretty common error, but still haven't found a solution for it. I am using async message sending: Queue adminQueue=session.createQueue("admin_queue"); MessageConsumer mc=session.createConsumer(adminQueue); mc.setMessageListener(new AdminListener(emfMaster,ps)); connection.start(); this.statisticProvider = new AdminStats(adminQueue, mc, session); And I need to receive statstics for it, using a Stat Plugin for ActiveMQ, which is stuffed into my AdminStats class(it starts a new

activemq No suitable Log constructor

丶灬走出姿态 提交于 2019-12-11 13:47:00
问题 this is driving me insane. I'm simply trying to run activemq on Mac OSX 10.5.7. I have java version 1.5.0_19 and activemq 5.2.0. Below is the exception I get when running bin/activemq. It seems to be unable to find log4j which is odd considering it comes with activemq and is definitely in the lib/optionals directory. The only thing I can think of is that I have a conflict somewhere, but I can't imagine how this is possible. If anyone has any tips whatsoever I'm all ears, googling produced

How to use firewall with ActiveMQ?

狂风中的少年 提交于 2019-12-11 13:23:52
问题 I have this ports configured in my 3 virtual machines running Zookeeper and ActiveMQ . root@mom3:~# ufw status verbose Status: active Logging: on (low) Default: deny (incoming), allow (outgoing), disabled (routed) New profiles: skip To Action From -- ------ ---- 22 ALLOW IN Anywhere 2881 ALLOW IN Anywhere 2888 ALLOW IN Anywhere 3888 ALLOW IN Anywhere 61616 ALLOW IN Anywhere 61617 ALLOW IN Anywhere 22 (v6) ALLOW IN Anywhere (v6) 2881 (v6) ALLOW IN Anywhere (v6) 2888 (v6) ALLOW IN Anywhere (v6)

How do I set the prefetch limit for NMS listener container

[亡魂溺海] 提交于 2019-12-11 12:59:54
问题 Other than on the connection URL, how do I set the prefetch limit in spring config. I can't find any doc on any of the properties and the param on the Connection URL doesn't seem to work. Besides, I need to do this on the consumer level. Here is my config below. <nms:listener-container connection-factory="SingleConnectionFactory" concurrency="${GraphManagerService.NMS.Consumers}" auto-startup="false"> <nms:listener ref="MessageListenerAdapter" destination="${GraphManagerService.NMS.QueueName}