标签: activemq-classic

消息发送后立即检索 JMS 标头而不消耗消息

如何在发送消息后检索 JMS 消息标头但不使用该消息?

这是我的消息发送代码

jmsTemplate.convertAndSend(que, text, message -> {

       LOGGER.info("setting JMS Message header values");    
       message.setStringProperty(RequestContext.HEADER_ID, id);
     //  LOGGER.info(message.getJMSMessageId()); -- this gives a null value here
       return message;
 });
Run Code Online (Sandbox Code Playgroud)

消息头仅在消息发布到队列后生成,因此在使用 MessagePostProcessor 时是否有一种简单的方法来检索 JMS 消息头?

我已经引用了链接 -这里这里,但没有太多帮助:(

spring activemq-classic jmstemplate spring-jms

2
推荐指数
1
解决办法
3175
查看次数

为什么默认配置下的ActiveMQ只使用70%的percentOfJvmHeap

ActiveMQ 的默认配置在activemq.xml文件中声明如下:

<beans>
 ...
    <broker>
       ...
        <systemUsage>
            <systemUsage>
                <memoryUsage>
                    <memoryUsage percentOfJvmHeap="70"/>
                </memoryUsage>
                 ...
            </systemUsage>
        </systemUsage>
    </broker>
</beans>
Run Code Online (Sandbox Code Playgroud)

仅使用 JVM 堆的 70% 而不是 100% 作为内存限制的原因是什么?

这不是浪费资源吗?

java activemq-classic

2
推荐指数
1
解决办法
1714
查看次数

如何在 Mac OS 中的系统启动时启动 ActiveMq

有没有办法在Mac OS系统启动时自动启动activemq服务器?我希望每次启动系统时它都会启动。

我试图在官方文档中查找,但没有找到。

macos activemq-classic system startup

2
推荐指数
1
解决办法
3632
查看次数

如何将二进制消息从 python stomp 发送到 ActiveMQ

我正在尝试 Pythonstomp客户端通过 ActiveMQ 向 JVM 发送二进制消息,我需要它作为 JMS BytesMessage,但它是作为TextMessage.

我想这应该是可能的,因为我可以做相反的事情(JVM 到 Python),但不确定如何做。

有人知道其中的窍门吗?

activemq-classic jms stomp

2
推荐指数
1
解决办法
2475
查看次数

无法使用 STOMP 向 activemq 发送消息

我正在尝试使用 STOMP 协议向我的 activemq 发送消息,但出现以下错误:

(limetray) Vaibhavs-MacBook-Air:Desktop vaibhav$ python receiver_topic.py heyhey
Unknown response frame type: ';activemq' (frame length was 11)
Unknown response frame type: '
                              ' (frame length was 2)
Unknown response frame type: ')' (frame length was 2)
Unknown response frame type: '
                              ' (frame length was 1)
Unknown response frame type: 'tcpnodelayenabled' (frame length was 20)
Unknown response frame type: 'sizeprefixdisabled' (frame length was 20)
Unknown response frame type: '  cachesize' (frame length was 11)
Unknown response frame …
Run Code Online (Sandbox Code Playgroud)

python activemq-classic stomp

2
推荐指数
1
解决办法
2581
查看次数

为什么我应该使用ActiveMQ发送电子邮件?

很多星期前我推荐我发送电子邮件,ActiveMQ.所以我搜索有关这方面的信息,但我完全不明白这是如何工作的.有人可以解释一下为什么我应该使用ActiveMQ发送电子邮件?

java messaging activemq-classic

1
推荐指数
1
解决办法
3806
查看次数

ActiveMQ-CPP和Visual Studio 2003

ActiveMQ CPP和Visual Studio 2003

我有一个要求让AMQ使用一些需要VS 7.1的代码,但是我很难获得它和使用VS 7.1构建的各种Apache库如apr等.有一个针对AMQ-CPP的vs2008解决方案/项目,我已将其用作模板,并尝试为VS 7.1创建一个,

但是在尝试构建时,我会收到如下错误:

"\amq\activemq-cpp-library-3.4.1\src\main\activemq\util\primitivemap.cpp(70): fatal error C1001: INTERNAL COMPILER ERROR  (compiler file 'f:\vs70builds\3077\vc\Compiler\Utc\src\P2\main.c', line 148)"
Run Code Online (Sandbox Code Playgroud)

总之,有没有人能够使用VS 7.1构建并成功运行AMQ?是否支持编译器?

我已经浏览了常见问题解答(没有找到任何表明方式或其他方式)并在他们的ML上发布了问题,但无济于事.

任何信息或链接都会很棒.

http://activemq.apache.org/cms/index.html

c++ activemq-classic build activemq-cpp visual-studio

1
推荐指数
1
解决办法
398
查看次数

使用来自队列的activemq,camel选择器选择特定的头消息

如何使用队列中的特定标头消息.我正在使用camel activemq.

routebuilder:

.....
    from("activemq:Q1").
      .setHeader("myHeader",xpath(...))
          .to("activemq:Q2")
.....
Run Code Online (Sandbox Code Playgroud)

我尝试使用那些在另一个类中具有特定标题的消息.

....
ConsumerTemplate consumerTemplate = camelContext.createConsumerTemplate();
Exchange exchange = consumerTemplate.receive("activemq:Q2",10000);

String body = exchange.getIn().getBody(String.class);
String customvalue = exchange.getIn().getHeader("myHeader", String.class);
.....
Run Code Online (Sandbox Code Playgroud)

我怎样才能获得myHeader = 123的那些消息.

activemq-classic jms apache-camel custom-headers

1
推荐指数
1
解决办法
2958
查看次数

activemq用户无权创建:topic://ActiveMQ.Advisory.Connection

我正在尝试在activemq中使用授权,但是现在停滞了一段时间。

这是我的Java代码,删除授权插件后一切正常。我正在尝试创建一个名为“ room2”的主题。

        Context jndiContext = new InitialContext();
        ConnectionFactory connectionFactory;
        connectionFactory = (ConnectionFactory) jndiContext
                .lookup("ConnectionFactory");
        connection = connectionFactory.createConnection("system", "manager");
        session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        Topic t = session.createTopic("room2");
Run Code Online (Sandbox Code Playgroud)

这是我的activemq.xml:

<plugins>
                <simpleAuthenticationPlugin>
                        <users>
                                <authenticationUser username="system" password="manager"
                                        groups="admins,publishers,consumers"/>
                                <authenticationUser username="user" password="password"
                                        groups="admins,users,publishers"/>
                                <authenticationUser username="guest" password="password" groups="guests"/>
                        </users>
                </simpleAuthenticationPlugin>
                 <authorizationPlugin>
                        <map>
                                <authorizationMap>
                                        <authorizationEntries>
                                                <authorizationEntry topic="room2" read="consumers" write="publishers" admin="admins" />
                                        </authorizationEntries>
                                </authorizationMap>
                        </map>
                </authorizationPlugin> 
        </plugins>
Run Code Online (Sandbox Code Playgroud)

这是我得到的错误:

User system is not authorized to create: topic://ActiveMQ.Advisory.Connection
Run Code Online (Sandbox Code Playgroud)

如果我使用<authorizationEntry topic=">" read="consumers" write="publishers" admin="admins" />,那么它可以正常工作,那么究竟是什么>意思呢?

activemq-classic authorization

1
推荐指数
1
解决办法
6386
查看次数

SpringBoot应用程序发布和阅读ActiveMQ主题

我有两个接收者,应该从一个主题中阅读。但是只有一个随机接收者会收到消息,就像它实际上是从队列中读取而不是主题一样。我已经读过这个答案,但是似乎没有用。这是我的代码。

Application.java:

package hello;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jms.DefaultJmsListenerContainerFactoryConfigurer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.jms.annotation.EnableJms;
import org.springframework.jms.config.DefaultJmsListenerContainerFactory;
import org.springframework.jms.config.JmsListenerContainerFactory;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.support.converter.MappingJackson2MessageConverter;
import org.springframework.jms.support.converter.MessageConverter;
import org.springframework.jms.support.converter.MessageType;

import javax.jms.ConnectionFactory;

@SpringBootApplication
@EnableJms
public class Application {
    public static final String MAILBOX_TOPIC = "inbox.topic";

    public static void main(String[] args) {
        // Launch the application
        ConfigurableApplicationContext context = SpringApplication.run(Application.class, args);

        JmsTemplate jmsTemplate = context.getBean(JmsTemplate.class);

        // Send a message with a POJO - the template reuse the message converter
        System.out.println("Sending an …
Run Code Online (Sandbox Code Playgroud)

activemq-classic spring-boot

1
推荐指数
1
解决办法
3190
查看次数