总的来说,我对消息传递很陌生,但已经加入了一个大量使用消息传递的支持项目。
因此,该项目使用 Tibco,并且在 Tibco 中,通过使用图形 UI,将主题连接到队列非常容易。
现在我们想要转向活跃的 mq - 并且刚刚开始阅读它 - 我没有找到一种简单的方法来将主题桥接到队列
有任何想法吗 ?
谢谢
目前,我的 Spring Boot application.yaml 中有以下属性。
ibm:
mq:
queueManager: <queue-manager>
channel: <channel>
connName: <host>(<port>)
queue: <queue-name>
user: <user>
password: <password>
Run Code Online (Sandbox Code Playgroud)
我想在没有密码的情况下进行连接,为此我必须设置jmsConnectionFactory.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, false);属性。
无论如何,我可以通过将参数传递给 connName 在 application.yaml 中指定此属性吗?
在哪里可以找到与 IBM MQ 相关的所有预定义的关键 spring-boot 应用程序属性?
我使用ActiveMQ Artemis进行数据传递,但队列中的数据不是持久的。
当我使用 artemis.cmd stop 关闭服务器并使用 artemis.cmd run 重新启动时,队列中的消息计数变为 0。
经纪人.xml:
<persistence-enabled>true</persistence-enabled>
<max-disk-usage>100</max-disk-usage>
Run Code Online (Sandbox Code Playgroud) 我目前正在致力于将 IBM Webshere 应用程序迁移到 Spring Boot。
作为其中的一部分,有一个 MDB 类需要转换为@JmsListener. 该 MDB 有一个监听多个队列的方法。我想对@JmsListener多个目的地进行同样的操作。我看到了这个线程,但这不起作用。
这是当前的 MDB 配置:
豆1
<bean id="myAppabcResponseMDB" class="company.myApp.service.mdb.MyAppMessageListenerMDB"/>
<bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="jmsConnectionFactory"/>
<property name="destination" ref="myAppabcResponseDest"/>
<property name="messageListener" ref="myAppabcResponseMDB"/>
<property name="maxConcurrentConsumers" value="5"/>
<property name="sessionTransacted" value="true"/>
<property name="transactionManager" ref="transactionManager" />
<property name="taskExecutor" ref="myTaskExecutor" />
</bean>
<bean id="myAppabcResponseDest" name="jms/myAppESBResponse" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="jms/myAppabcResponse"/>
<property name="resourceRef" value="true"/>
</bean>
Run Code Online (Sandbox Code Playgroud)
<bean id="myAppRequestMDB" class="company.myApp.service.mdb.MyAppMessageListenerMDB"/>
<bean id="jmsContainer2" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="jmsConnectionFactory"/>
<property name="destination" ref="myAppRequestDest"/>
<property name="messageListener" ref="myAppRequestMDB"/>
<property name="maxConcurrentConsumers" …Run Code Online (Sandbox Code Playgroud) 我想用JMS和Spring发送短信,我该怎么做?你可以给我教程或样品,可能吗?
我正在使用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
我无法理解JMS AutoAck网站上的以下几点:AUTO_ACKNOWLEDGE
在调用消费者的MessageListener之后onMessage方法成功返回之后(根据我的理解,它可能仍在进行中)
但据我所知,消费者实现MessageListener并执行了onMessage()方法中的所有处理(由消费者实现)
还有一个问题:我无法理解之间的差异AUTO_ACKNOWLEDGE和DUPS_OK_ACKNOWLEDGE。
我读的是:DUPS_OK_ACKNOWLEDGE懒洋洋地承认,并可能再次传递相同的消息,但无法理解其实际含义。
请在AUTO_ACKNOWLEDGE需要的地方和DUPS_OK_ACKNOWLEDGE需要的地方提供一个实际的例子来帮助我
2013年9月5日添加:从Java 重新交付和交易中添加一个点
考虑在消息处理期间发生的故障。消息发生了什么?邮件会丢失还是重新传递以便以后成功处理?这些问题的答案取决于您选择的 交易选项。
我正在尝试将我的应用程序部署到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 …
我正在尝试在apache-camel路由中读取jms头.以下是我正在阅读正文和标题的路线.
String endPointTopic = "activemq:topic:geoLoc";
String endPointTopicOut = endPointTopic + "_outbox";
from(endPointTopic)
.log("Message from Topic is ${body} & header is ${header.Action}")
.to(endPointTopicOut);
Run Code Online (Sandbox Code Playgroud)
基本上从日志中我可以看到以下内容,这意味着我能够读取正文而不是标题中的id.
来自Topic的消息是GeoLocationInfoDTO {id = 2,geoLocationUUId ='null',geoLocationName ='null',geoLocationDesc ='null',geoLocationPolygon ='null',geoLocationCenterLatitude ='null',geoLocationCenterLongitude ='null'}&header is
以下是我通过jms模板将消息发布到activeMQ的代码.
private MessageHeaders getMessageHeaders(HttpMethod action) {
log.debug("DomainPublisher : getMessageHeaders");
Map <String, Object> headerMap = new HashMap<>();
headerMap.put("Action", action);
return new MessageHeaders(headerMap);
}
public void publish(BaseDTO dto, HttpMethod action) {
log.debug("DomainPublisher : type is : {} : ", dto.getClass().getName());
getJmsMessagingTemplate().convertAndSend(topicMap.get(dto.getClass().getName()), dto, getMessageHeaders(action));
}
Run Code Online (Sandbox Code Playgroud)
注意:我还尝试将标头ID记录为$ {header.id}而不是$ {header.Action},但没有任何内容被打印出来.
我还想知道jms消息可用的所有头文件.
两者之间有什么区别,因为两者都是基于通过主题/主题在它们之间交换消息的发布者和订阅者的相同方法?
jms ×10
java ×4
spring-boot ×2
spring-jms ×2
amqp ×1
apache-camel ×1
ibm-mq ×1
java-ee ×1
jboss ×1
jmstemplate ×1
queue ×1
sms ×1
spring ×1