Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Consumer endpoints

...

Simple examples

Code Block
langxml
<jms:consumer service="my:ConsumerService"
              endpoint="jbi"
              destinationName="my.queue"
              connectionFactory="#connectionFactory"
              concurrentConsumers="8" />

...

Take a look at the documentation from the Jencks project for more informations

Other JMS providers

For other JMS providers, the ConnectionFactory is usually retrieved using JNDI.

Code Block
langxml

<beans xmlns:jee="http://www.springframework.org/schema/jee">
  <jee:jndi-lookup id="connectionFactory" jndi-name="weblogic.jms.XAConnectionFactory">
    <jee:environment>
      java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
      java.naming.provider.url=t3://localhost:7001
    </jee:environment>
  </jee:jndi-lookup>
<beans>

Check your JMS provider for the specific configuration needed.

Tips

Using a marshaler

The org.apache.servicemix.jms.endpoints.JmsConsumerMarshaler interface defines the way the incoming JMS message is transformed. There are two implementations:

  • DefaultConsumerMarshaler for <jms:consumer/> and <jms:jca-consumer/> endpoints
  • JmsSoapConsumerMarshaler for <jms:soap-consumer/> endpoints

For soap enabled endpoints, there is not particular need to modify the way the marshaling is done. But the DefaultConsumerMarshaler does not support the whole range of messages. So from time to time, you will need to process JMS properties or receive a Map based message. In such a case, you would create your own class implementing the JmsConsumerMarshaler interface and configure it on the endpoint:

Code Block
langxml

<jms:consumer service="my:ConsumerService"
              endpoint="jbi"
              destinationName="my.queue"
              connectionFactory="#connectionFactory"
              marshaler="#marshaler" />
<bean id="marshaler" class="my.package.MyMarshaler" />

Reference

ServiceMix uses spring JMS support, hence most of the following properties are fully documented at the following locations:

Common properties

Name

Type

Description

Required

service

QName

the service name of the proxied endpoint

yes

endpoint

String

the endpoint name of the proxied endpoint

yes

interfaceName

QName

the interface name of the proxied endpoint

 

 

 

 

 

targetService

QName

the service name of the target endpoint

no (defaults to the service attribute)

targetEndpoint

String

the endpoint name of the target endpoint

no (defaults to the endpoint attribute)

targetInterface

QName

the interface name of the target endpoint

no

targetUri

String

the URI of the target endpoint

no

 

 

 

 

marshaler

 

 

 

synchronous

 

 

 

destinationChooser

 

 

 

destinationResolver

 

 

 

pubSubDomaom

 

 

 

connectionFactory

 

 

 

 

 

 

 

useMessageIdInResponse

Boolean

 

 

replyDestination

Destination

 

 

replyDestinationName

String

 

 

replyExplicitQosEnabled

boolean

 

 

replyDeliveryMode

int

 

 

replyPriority

int

 

 

replyTimeToLive

long

 

 

replyProperties

Map

 

 

 

 

 

 

stateless

boolean

 

 

storeFactory

StoreFactory

 

 

store

Store

 

 

...