标签: activemq-classic

如何将对ActiveMQ的JMX API的访问限制为仅限localhost/intranet?

我刚开始使用JMX来监控activemq,我启用了远程监控.现在的问题是,我如何只允许localhost访问JMX API?或者有没有办法在不启用远程监控的情况下使用JMX API.

activemq-classic jmx

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

指定persistenceAdapter时ActiveMQ代理配置错误:“应为'{WC [## other:“ http://activemq.apache.org/schema/core”]}中的一个”

我正在设置一个简单的ActiveMQ嵌入式代理。在我尝试配置持久性适配器之前,它工作正常。我基本上只是从http://activemq.apache.org/persistence.html#Persistence-ConfiguringKahaPersistence复制配置。当我将此配置添加到我的Spring配置中时,如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:amq="http://activemq.apache.org/schema/core"
   xsi:schemaLocation="
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core-5.3.0.xsd">

<amq:broker useJmx="true" persistent="true" brokerName="localhost">
    <amq:transportConnectors>
        <amq:transportConnector name="vm" uri="vm://localhost"/>            
    </amq:transportConnectors>
   <amq:persistenceAdapter>
    <amq:kahaPersistenceAdapter directory="activemq-data" maxDataFileLength="33554432"/>
   </amq:persistenceAdapter>
  </amq:broker>
   </beans>
Run Code Online (Sandbox Code Playgroud)

我得到错误:

cvc-complex-type.2.4.a: Invalid content was found starting with element 'amq:persistenceAdapter'. 
 One of '{WC[##other:"http://activemq.apache.org/schema/core"]}' is expected.
Run Code Online (Sandbox Code Playgroud)

当我取出amq:persistenceAdapter元素时,它可以正常工作。无论我在主体中包括哪个持久适配器,例如jdbc,journal等,都会发生相同的错误。

任何帮助将不胜感激。

谢谢。

spring activemq-classic

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

我在哪里可以下载ActiveMQ源分发?

我一直在尝试下载activeMQ的源代码发布超过一周,而我得到的只是一个未找到服务器的页面.我已经通过电子邮件发送了apache并且没有得到任何回复.有一次镜像站点把我带到一个名人八卦网站.我可以得到二进制分发但我需要源代码.这是我一直在尝试的链接

http://www.apache.org/dyn/closer.cgi?path=%2Factivemq%2Fapache-activemq%2F5.4.0%2Factivemq-parent-5.4.0-source-release.tar.gz

有谁知道这是怎么回事?

谢谢,

丽贝卡

activemq-classic

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

问题与骆驼路线!(非常沮丧)

我有以下路线:

    <!-- RC get projects -->
<route id="sqlRCprojects">
    <setBody>
            <constant>SELECT [No_] FROM [navview].[dbo].[job] WHERE [Project Director] = 'RC';</constant>
    </setBody>
    <to uri="jdbc:sql2005navview?readSize=0"/>
    <split>
        <tokenize token=","/>
        <setHeader headerName="project">
            <javaScript>request.body.substring(6, (""+request.body).length-1)</javaScript>
            </setHeader>
        <to uri="activemq:queue:test.line"/>
    </split>
    <to uri="mock:result"/>
    </route>
Run Code Online (Sandbox Code Playgroud)

它使用这个bean:

    <bean id="sql2005navview" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<property name="url" value="jdbc:sqlserver://**.**:56395;databaseName=test" />
<property name="username" value="**" />
<property name="password" value="**" />
Run Code Online (Sandbox Code Playgroud)

这失败并显示以下消息:

         INFO | Apache Camel 2.7.0 (CamelContext: camel) is shutdown in 0.009 seconds
ERROR | Context initialization failed
org.apache.camel.RuntimeCamelException: java.util.NoSuchElementException
        at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1139)
        at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
        at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:238) …
Run Code Online (Sandbox Code Playgroud)

apache activemq-classic apache-camel

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

Java 生产者、Stompy Python 消费者、ActiveMQ

我有一个 java ActiveMQ 生产者,它将 Integer 消息生成到 ObjectMessage 实例中。

在 python 方面,我使用 stomp python 来监听队列。但是,尽管所有标头均已正确接收,但我收到空消息正文。

此外,如果我在 java 端将消息类型更改为 TextMessage,我会在 python-consumer 端得到正确的消息。

我也尝试过使用 PyactiveMQ 但效果相同

任何建议将不胜感激!

编辑:这是一个样板java生产者代码和python订户代码,我编写它是为了在python上测试stomp

public class App 
{
Connection conn;
Session session;
MessageProducer producer;

public void registerPublisher(String queueName, String url) throws JMSException {
    ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("system", "manager" ,url);
    conn = cf.createConnection();
    conn.start();
    session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
    Destination destination = session.createQueue(queueName);
    producer = session.createProducer(destination);
    producer.setDeliveryMode(DeliveryMode.PERSISTENT);

}

public void send(int c) {

    for (int i=0; i<c; ++i) { …
Run Code Online (Sandbox Code Playgroud)

python java activemq-classic stomp

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

JMS/ActiveMQ:使用对象作为类成员发送对象

我正在使用ActiveMQ(使用Spring)将消息发送到远程OSGi-Container.这非常好,但有一个问题.

我有两个实现Serializable的类.一个类是另一个类的类成员,如下所示:

public class Member implements Serializble {
private int someValue;
private static final long serialVersionUID = -4329617004242031635L;
... }

public class Parent implements Serializable {
    private static final long serialVersionUID = -667242031635L;
private double otherValue;
private Member;
}
Run Code Online (Sandbox Code Playgroud)

因此,当发送Parent实例时,Parent的Member为null.

希望你明白我的问题是什么:)

编辑:有趣的问题:我的类中有一个java.util.date正确序列化,但这是唯一的,所有双打等都是null

activemq-classic jms spring-jms

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

JMS自动确认使用者处理发生在onMessage中

我无法理解JMS AutoAck网站上的以下几点AUTO_ACKNOWLEDGE

在调用消费者的MessageListener之后onMessage方法成功返回之后(根据我的理解,它可能仍在进行中)

但据我所知,消费者实现MessageListener并执行了onMessage()方法中的所有处理(由消费者实现)

还有一个问题:我无法理解之间的差异AUTO_ACKNOWLEDGEDUPS_OK_ACKNOWLEDGE
我读的是:DUPS_OK_ACKNOWLEDGE懒洋洋地承认,并可能再次传递相同的消息,但无法理解其实际含义。
请在AUTO_ACKNOWLEDGE需要的地方和DUPS_OK_ACKNOWLEDGE需要的地方提供一个实际的例子来帮助我


2013年9月5日添加:从Java 重新交付和交易中添加一个点

考虑在消息处理期间发生的故障。消息发生了什么?邮件会丢失还是重新传递以便以后成功处理?这些问题的答案取决于您选择的 交易选项。

java jboss activemq-classic jms

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

通过Java为ActiveMQ/Jolokia/HawtIO提供的凭据

我知道5.9.0的HawtIO/Jolokia的默认密码是在\ conf \文件夹中设置的

管理员/管理员系统/经理等

但是,在尝试通过Java执行restful命令时,这些密码都不起作用:

CredentialsProvider credsProvider = new BasicCredentialsProvider();
credsProvider.setCredentials(new AuthScope(null, -80), new UsernamePasswordCredentials("admin", "admin"));
CloseableHttpClient httpclient0 = HttpClients.custom().setDefaultCredentialsProvider(credsProvider).build();
URI uri0 = URI.create("http://localhost:8161/hawtio/auth/login/");
HttpGet httpget = new HttpGet(uri0);
HttpResponse r0 = httpclient0.execute(httpget);
System.out.println("Login form get: " + r0.getStatusLine());
for (Header h : r0.getAllHeaders())
  System.out.println(h.getName() + "/" + h.getValue());
HttpEntity entity = r0.getEntity();

InputStream is0 = entity.getContent();
String resp = IOUtils.toString(is0);
System.out.println("Response0: " + resp);
Run Code Online (Sandbox Code Playgroud)

以下代码只是吐出403 Forbidden回复!我尝试了很多用户名和密码的组合.

Login form get: HTTP/1.1 403 Forbidden
Access-Control-Allow-Origin/*
Content-Length/0
Server/Jetty(7.6.9.v20130131)
Run Code Online (Sandbox Code Playgroud)

什么在这里有用?

我记得在运行5.8.0时"admin/admin"有效,但我想用5.9.0代替.仅仅因为用户名和密码改变而退出此版本将是蹩脚的.

此外,哪个\ conf文件决定了这个密码......?

java apache activemq-classic hawtio jolokia

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

经纪人已经创建了JMS

我正在尝试将我的应用程序部署到Glassfish 3.2服务器.当我这样做时,我在日志中收到以下消息:

16:01:37.591 [admin-thread-pool-4848(3)] INFO  j.resourceadapter.mqjmsra.lifecycle.start - SJSMQ LifecycleManagedBroker configuration=
brokerInstanceName       =imqbroker
brokerBindAddress        =null
brokerPort               =7676
brokerHomeDir            =/opt/glassfish3/mq
brokerLibDir             =/opt/glassfish3/mq/lib
brokerVarDir             =/opt/glassfish3/glassfish/domains/medallion/imq
brokerJavaDir            =/usr/java/jdk1.6.0_26/jre
brokerArgs               =null
MasterBroker             =null
brokerId                 =null
adminUsername            =admin
adminPassword            =<default>
adminPassFile            =null
ConnectionURL            =
dbType                   =null
dbProps                  ={}
dsProps                  ={}
useJNDIRmiServiceURL     =true
useSSLJMXConnector       =true
brokerEnableHA           =false
clusterId                =null
rmiRegistryPort          =8686
startRmiRegistry         =false
brokerStartTimeout       =  jmxServiceURL            =null
    60000
Run Code Online (Sandbox Code Playgroud)

在这之后,事情变得有点疯狂:

16:01:37.608 [admin-thread-pool-4848(3)] ERROR j.e.r.r.c.sun.enterprise.connectors.log - RAR6035 : Resource adapter start failed. 
javax.resource.spi.ResourceAdapterInternalException: java.security.PrivilegedActionException: javax.resource.spi.ResourceAdapterInternalException: MQJMSRA_RA4001: start:Aborting:Exception starting EMBEDDED …

java activemq-classic jms java-ee

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

如何使用@JmsListener 暂停和开始消费消息

我使用的是 Spring Boot 1.3.2 版。我正在使用@JmsListener 为我使用 JmsTemplate 创建/生成的消息使用来自 activemq 的消息。这是代码:

@JmsListener(destination = "myqueue")
public void consumeMsg(Object requestBody)
    try {
        javaMailSender.send(requestBody);
    } catch (MailException ex) {
        LOG.error(ex.getLocalizedMessage(), ex);
        if(ex.getMessage().contains(SMTP_CONNECTION_FAILURE) && activeMqMsg.getIntProperty("RETRYCOUNT") == 1) {
            producer.send("myqueue",requestBody)
        }
        else {
            producer.send("manualqueue",requestBody)
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

现在,当 smtp 出现连接失败错误时,我想暂停 @JmsListener 一段时间,然后重新开始使用消息。对于使用@JmsListener 的这个用例,我还没有看到更好的示例。由于我使用的是spring boot,我在应用程序属性中添加了activemq连接参数,我不需要编写任何代码来创建连接工厂,设置队列......等你能帮忙吗?

java activemq-classic spring-jms spring-boot

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

Apache ActiveMQ 在多个消费者上的异常行为

我正在使用 Jboss-fuse-6.3 和外部 Apache-activemq-5.15.2。我在一个队列上绑定了 50 个消费者,在 Active MQ 门户的“活动消费者”页面上,我注意到所有 50 个消费者都已绑定,但队列上的消息分布并不相同。

附上屏幕截图。在会话 ID“1”上,排队消息计数约为 1010 条,但在其他消费者会话上,排队消息仅为 10 条。

我正在对来自 Apache Camel Route 的消息进行排队。下面是我的蓝图 xml(我做错了什么吗)

<bean class="org.apache.activemq.spring.ActiveMQConnectionFactory" id="connectionFactory">
    <property name="brokerURL" value="tcp://localhost:61616"/>
    <property name="userName" value="admin"/>
    <property name="password" value="admin"/>
    <property name="trustAllPackages" value="true"/>
</bean>
<bean class="org.apache.camel.component.jms.JmsConfiguration" id="jmsConfig">
    <property name="connectionFactory" ref="connectionFactory"/>
</bean>
<bean class="org.apache.activemq.camel.component.ActiveMQComponent" id="activemq">
    <property name="configuration" ref="jmsConfig"/>
</bean>

<bean class="org.apache.activemq.spring.ActiveMQConnectionFactory" id="connectionFactory">
    <property name="brokerURL" value="tcp://localhost:61616"/>
    <property name="userName" value="admin"/>
    <property name="password" value="admin"/>
    <property name="trustAllPackages" value="true"/>
</bean>
<bean class="org.apache.camel.component.jms.JmsConfiguration" id="jmsConfig">
    <property name="connectionFactory" ref="connectionFactory"/>
</bean>
<bean class="org.apache.activemq.camel.component.ActiveMQComponent" id="activemq">
    <property …
Run Code Online (Sandbox Code Playgroud)

java jboss activemq-classic apache-camel

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