we are trying to create Solace JMS connection through Spring 4.x but we are facing below issue while running main class.
INFO | Connection attempt failed to host '192.168.56.101' ConnectException com.solacesystems.jcsmp.JCSMPTransportException: (Client name: DESKTOP-330QOHF/7332/#000a0001 Local port: -1 Remote addr: 192.168.56.101:24) - Error communicating with the router. cause: java.net.ConnectException: Connection timed out: no further information ((Client name: DESKTOP-330QOHF/7332/#000a0001 Local port: -1 Remote addr: 192.168.56.101:24) - )
also find attached spring-context file for Solace server configuration.
Thanks
Here is my Spring configuration
http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-3.1.xsd" xmlns:jms="http://www.springframework.org/schema/jms" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.springframework.org/schema/beans">
<bean autowire="default" lazy-init="default"
class="org.springframework.jndi.JndiTemplate" id="solaceJndiTemplate">
<property name="environment">
<map>
<entry value="smf://192.168.56.101:24" key="java.naming.provider.url" />
<entry value="com.solacesystems.jndi.SolJNDIInitialContextFactory"
key="java.naming.factory.initial" />
<entry value="spring_user@Solace_Spring_VPN" key="java.naming.security.principal" />
<entry value="spring_password" key="java.naming.security.credentials" />
</map>
</property>
</bean>
<bean autowire="default" lazy-init="default"
class="org.springframework.jndi.JndiObjectFactoryBean" id="solaceConnectionFactory">
<property name="jndiTemplate" ref="solaceJndiTemplate" />
<property name="jndiName" value="JNDI/CF/ncs" />
</bean>
<bean class="org.springframework.jms.connection.CachingConnectionFactory"
id="solaceCachedConnectionFactory">
<property name="targetConnectionFactory" ref="solaceConnectionFactory" />
<property name="sessionCacheSize" value="10" />
</bean>
<bean class="org.springframework.jndi.JndiObjectFactoryBean" id="destination">
<property name="jndiTemplate" ref="solaceJndiTemplate" />
<property name="jndiName" value="JNDI/Q/requests" />
</bean>
<bean class="org.springframework.jms.core.JmsTemplate" id="jmsTemplate">
<property name="connectionFactory" ref="solaceCachedConnectionFactory" />
<property name="defaultDestination" ref="destination" />
<property name="deliveryPersistent" value="true" />
<property name="explicitQosEnabled" value="true" />
</bean>
-
<bean class="com.solacesystems.integration.spring.MessageProducer"
id="messageProducer">
<property name="jmsTemplate" ref="jmsTemplate" />
</bean>
<bean class="com.solacesystems.integration.spring.MessageConsumer"
id="messageConsumer">
</bean>
-
<bean
class="org.springframework.jms.listener.DefaultMessageListenerContainer"
id="jmsContainer">
<property name="connectionFactory" ref="solaceCachedConnectionFactory" />
<property name="destination" ref="destination" />
<property name="messageListener" ref="messageConsumer" />
</bean>