3
votes

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>

1

1 Answers

1
votes

The error indicates that network connectivity to 192.168.56.101:24 has failed.

Please ensure that 192.168.56.101:24 is the correct IP address and messaging port of your Solace router and that there are no firewalls between you and the Solace message broker. Note that the default port is 55555 and not 24.

You can verify the IP address and ports used by executing the following CLI commands on the Solace message broker.

  1. show service will list the port for the messaging interface. You are looking for the SMF over TCP port. The default port number is 55555.

  2. On a Solace PubSub+ hardware appliance, show ip vrf msg-backbone will provide you with the IP address of the hardware appliance.

  3. On a Solace PubSub+ software messaging broker, show ip vrf management will provide you with it's IP address.