在 Solace 主题上发布 JMS 消息



我在Solace服务器主题上发布JMS消息时遇到问题。 实际上,我们能够使用 jmsTemplate.send(( 方法成功发送消息。 但无法在慰藉客户端 GUI 上看到消息计数。 以下是我的安慰配置。

<?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:util="http://www.springframework.org/schema/util"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.1.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.1.xsd">
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:messaging.properties</value>
</list>
</property>
<property name="ignoreResourceNotFound" value="true" />
<property name="ignoreUnresolvablePlaceholders" value="true" />
</bean>
<!-- Solace Broker Configuration Details -->
<bean id="solaceJndiTemplate" class="org.springframework.jndi.JndiTemplate"
lazy-init="default" autowire="default">
<property name="environment">
<map>
<entry key="java.naming.provider.url" value="${solace.url}" />
<entry key="java.naming.factory.initial"
value="com.solacesystems.jndi.SolJNDIInitialContextFactory" />
<entry key="java.naming.security.principal" value="${solace.userName}" />
<entry key="java.naming.security.credentials" value="${solace.passWord}" />
</map>
</property>
</bean>
<bean id="solaceConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean"
lazy-init="default" autowire="default">
<property name="jndiTemplate" ref="solaceJndiTemplate" />
<property name="jndiName" value="${solace.jndiName}" />
</bean>
<!-- <bean id="solaceCachedConnectionFactory"
class="org.springframework.jms.connection.CachingConnectionFactory">
<property name="targetConnectionFactory" ref="solaceConnectionFactory" />
<property name="sessionCacheSize" value="10" />
</bean> -->
<bean id="destination" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiTemplate" ref="solaceJndiTemplate" />
<property name="jndiName" value="${solace.topic}" />
</bean>
<!-- <bean id="topicDestination" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiTemplate" ref="solaceJndiTemplate" />
<property name="jndiName" value="${solace.topic}" />
</bean> -->
<bean id="solaceQueueJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="solaceConnectionFactory" />
<property name="defaultDestination" ref="destination" />
<property name="deliveryPersistent" value="false" />
<property name="explicitQosEnabled" value="true" />
<property name="pubSubDomain" value="false"/>
</bean>
<bean id="solaceTopicJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="solaceConnectionFactory" />
<property name="defaultDestination" ref="destination" />
<property name="deliveryPersistent" value="false" />
<property name="explicitQosEnabled" value="true" />
<property name="pubSubDomain" value="true"/>
</bean>
<bean id="solaceQueueBroker" class="com.isc.common.messaging.SolaceUtilityHelper">
<property name="jmsTemplate" ref="solaceQueueJmsTemplate" />
</bean>
<bean id="solaceTopicBroker" class="com.isc.common.messaging.SolaceUtilityHelper">
<property name="jmsTemplate" ref="solaceTopicJmsTemplate" />
</bean>
<bean id="messageBroker" class="com.isc.common.messaging.SolaceUtilityHelper">
<property name="activeBroker" value="${active.broker}" />
</bean>

<!-- <bean id="messageConsumer" class="com.isc.common.messaging.MessageConsumer">
</bean>
<bean id="jmsContainer"
class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="solaceCachedConnectionFactory" />
<property name="destination" ref="destination" />
<property name="messageListener" ref="messageConsumer" />
</bean> -->
</beans>

请任何人都可以建议我解决这个问题。

提前谢谢。 索拉布·马哈詹

根据您的评论,您似乎正在发布到主题,但没有配置用于假脱机消息的端点。

您可以参考 将主题订阅添加到队列 有关如何配置队列以假脱机发布到主题的消息的详细信息。

要确认,您可以验证消息是否列在"无订阅匹配日志"下。在SolAdmin中,您可以通过前往"日志记录和诊断"并选择"无订阅匹配日志"来查看它们。为此,相应的 CLI 命令是show log no-subscription-match

此外,应用程序连接的统计信息还将显示接收和发送的消息数以及任何丢弃原因。这可以通过前往"客户端"选项卡并选择"客户端"视图来查看。然后,双击您的客户并前往"统计"。或者,对此的 CLI 命令show client <your-client-name> message-vpn <your-vpn-name> stats

最新更新