Announcement Announcement Module
Collapse
No announcement yet.
dBus JMS with Spring Integration Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • dBus JMS with Spring Integration

    Hello Team,
    Does Spring Integration JMS provide support for dBus JMS by Deutsche Bank?
    Has anybody tried working with dBus using Spring Integration?

    I'm looking for help with integrating the connection factory of dBus JMS with Spring Integrations -
    int-jms:outbound-channel-adapter

    I'm currently using ActiveMQ and want to replace it with dBus.

    Appreciate if any samples can be provided for the same.

    Current JMS config below -
    Code:
    <!-- Inbound Connection Factory --> 
            <bean id="inboundJmsFactory" class="org.apache.activemq.ActiveMQConnectionFactory"> 
                    <property name="brokerURL" value="${int.jms.connectionfactory}" /> 
            </bean> 
    
            <!-- jms:message-driven-channel-adapter - Defines a JMS Message-Driven inbound 
                    Channel Adapter --> 
            <int-jms:message-driven-channel-adapter 
                    connection-factory="inboundJmsFactory" destination-name="${int.jms.inbound.queue}" 
                    channel="com.hcl.jms.inbound" extract-payload="true" /> 
    
            <!-- Outbound Connection Factory --> 
            <bean id="outboundJmsFactory" class="org.apache.activemq.ActiveMQConnectionFactory"> 
                    <property name="brokerURL" value="${int.actmq.jms.connectionfactory}" /> 
            </bean> 
    
            <!-- jms:outbound-channel-adapter - Defines an outbound JMS Message-sending 
                    Channel Adapter --> 
            <int-jms:outbound-channel-adapter 
                    destination-name="${int.jms.outbound.queue}" connection-factory="outboundJmsFactory" 
                    channel="com.hcl.jms.outbound" extract-payload="true" />

  • #2
    I am not familiar with that implementation but, since you are using destination names, to swap JMS providers it should be as simple as reconfiguring the connection factory beans with the new provider's equivalent class and appropriate properties.

    Comment


    • #3
      Thanks for taking time to reply Gary.
      Right now i'm following up with the dBus team with the ConnectionFactory and property details, yet to hear back from them.

      Meanwhile wanted to know if anybody have used dBus or tried configuring dBus with Spring Integration.

      As per your suggestion it makes sense to replace the connection factory and properties with that of dBus. I'm still unclear on how the dBus JMS works. Will come back once i hear from them and when i try it out by myself.

      Regards,
      PD

      Comment


      • #4
        If it's a compliant provider, using it with Spring, or Spring Integration, should be no different to any use of it with Java.

        Comment


        • #5
          Hi Gary,
          Dbus looks not so straight forward as the MQ series.

          Below mentioned are the properties that i'll need to configure in order to use Dbus JMS -

          Code:
          java.naming.provider.url = dbnaming:(ldap://ldapd1.uk.db.com:389/ou=user_dev,ou=dbusjms,ou=services,ou=global,dc=dbgroup,dc=com 
          ldap://ldapd2.uk.db.com:389/ou=user_dev,ou=dbusjms,ou=services,ou=global,dc=dbgroup,dc=com) 
          java.naming.factory.initial = com.db.appinfra.naming.dbContextFactory 
          java.naming.referral = follow 
          java.naming.security.credentials = XXX
          java.naming.security.principal = uid=<djxxx>,ou=Directory 
          Administrators,dc=dbgroup,dc=com
          Appreciate if you could guide me on how to implement this.

          P.S : I'm looking at using jndi.jnditemplate by passing the parameters as
          Code:
          <prop key="java.naming.factory.initial">com.db.appinfra.naming.dbContextFactory</prop>
          Not sure if i'm moving in the right direction.

          Comment


          • #6
            Why are you forced to use JNDI to lookup JMS resources?

            I would recommend you get it working with discrete JMS objects (such as the connection factory) first, and then move to JNDI.

            If you have no option but use JNDI, I would suggest using the namespace support rather than trying to roll your own...

            http://static.springsource.org/sprin...dy-schemas-jee

            Comment


            • #7
              Hi Gary,
              I tried as suggested , below is my configuration -

              JMS-Config contents
              Code:
              <jee:jndi-lookup jndi-name="${int.dbus.jms.connectionfactory}" id="dbusJmsConnectionFactory"
                              environment-ref="dbusEnvironment" />
              
              
                      <!-- jms:outbound-channel-adapter - Defines an outbound JMS Message-sending
                              Channel Adapter -->
                      <int-jms:outbound-channel-adapter
                              destination-name="${int.dbus.jms.outbound.queue}" channel="com.hcl.jms.outbound"
                              extract-payload="true" connection-factory="dbusJmsConnectionFactory" />
              Dbus infrastructure Config contents
              Code:
              <util:properties id="dbusEnvironment">
                              <prop key="java.naming.provider.url">${java.naming.provider.url}</prop>
                              <prop key="java.naming.factory.initial">${java.naming.factory.initial}</prop>
                              <prop key="java.naming.referral">${java.naming.referral}</prop>
                              <prop key="java.naming.security.credentials">${java.naming.security.credentials}</prop>
                              <prop key="java.naming.security.principal">${java.naming.security.principal}</prop>
                              <prop key="java.username">{java.username}</prop>
                              <prop key="java.password">{java.password}</prop>
                      </util:properties>
              Property File
              Code:
              # Placeholders for dBus jms:
              int.dbus.jms.connectionfactory=/db/us/GM/LS2API/S001DEV/db.messaging.outbound.q:qcf
              int.dbus.jms.outbound.queue=/db/us/GM/LS2API/S001DEV/db.messaging.outbound.q:queue
              java.naming.provider.url=dbnaming:(ldap://ldapd1.uk.db.com:389/ou=user_dev,ou=dbusjms,ou=services,ou=global,dc=dbgroup,dc=com)
              java.naming.factory.initial=com.db.appinfra.naming.dbContextFactory
              java.naming.referral=follow
              java.naming.security.credentials=xxxxx
              java.naming.security.principal=uid=dj0175,ou=Directory Administrators,dc=dbgroup,dc=com
              java.username=xxxxx
              java.password=yyyyy
              However I'm getting the below exception while loading the application-
              javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]

              Have attached the stack trace for the same.

              Comment


              • #8
                This looks like a simple LDAP authentication problem to me (invalid credentials for the LDAP lookup).

                Comment


                • #9
                  Resolved Dbus Connectivity Issue

                  Thanks Gary, yes there was a authentication issue.

                  After resolving the LDAP authentication issue, there was a Queue level authentication issue which was resolved using - UserCredentialsConnectionFactoryAdapter

                  Have placed the jms configuration below- would surely help developers looking for code samples to integrate Dbus Jms with Spring.

                  Code:
                  <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate"> 
                                  <property name="environment"> 
                                          <props> 
                                                  <prop key="java.naming.provider.url">${java.naming.provider.url}</prop> 
                                                  <prop key="java.naming.factory.initial">${java.naming.factory.initial}</prop> 
                                                  <prop key="java.naming.security.credentials">${java.naming.security.credentials}</prop> 
                                                  <prop key="java.naming.security.principal">${java.naming.security.principal}</prop> 
                                          </props> 
                                  </property> 
                          </bean> 
                  
                          <bean id="jmsConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean"> 
                                  <property name="jndiTemplate" ref="jndiTemplate" /> 
                                  <property name="jndiName" value="${int.dbus.jms.connectionfactory}" /> 
                          </bean> 
                  
                          <bean id="jmsDestinationResolver" 
                                  class="org.springframework.jms.support.destination.JndiDestinationResolver"> 
                                  <property name="jndiTemplate" ref="jndiTemplate" /> 
                                  <property name="cache" value="true" /> 
                          </bean> 
                  
                          <bean id="destination" class="org.springframework.jndi.JndiObjectFactoryBean"> 
                                  <property name="jndiTemplate" ref="jndiTemplate" /> 
                                  <property name="jndiName" value="${int.dbus.jms.outbound.queue}" /> 
                          </bean> 
                  
                          <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate"> 
                                  <property name="connectionFactory" ref="authenticationConnectionFactory" /> 
                                  <property name="destinationResolver" ref="jmsDestinationResolver" /> 
                                  <property name="defaultDestination" ref="destination" /> 
                          </bean> 
                  
                          <bean id="authenticationConnectionFactory" 
                                  class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter"> 
                                  <property name="targetConnectionFactory" ref="jmsConnectionFactory" /> 
                                  <property name="username" value="${java.username}" /> 
                                  <property name="password" value="${java.password}" /> 
                          </bean> 
                  
                          <int-jms:outbound-channel-adapter 
                                  destination-name="${int.dbus.jms.outbound.queue}" channel="com.hcl.jms.outbound" 
                                  extract-payload="true" jms-template="jmsTemplate" />

                  Gary and team, feel free to guide me in fine tuning the code further if any.

                  Regards,
                  PD

                  Comment

                  Working...
                  X