We need to use the jms:comsumer to consume the message and send it to the
bean component, this bean will do some sets of business and send it to the
provider to consume this message.  We need to add the replyDestinationName
property to jms:provider? what is this for? which queue it is supposed to
be.  We use this config, but it is not quiet working and we got the queue
channel overload it to give connection error 2099.

Jms config 

<jms:consumer service="edddstub:InMessage" 
                                                
targetService="edddstub:engineStubService"
              endpoint="jbi"
              destinationName="DDD.REQ.Q"
              connectionFactory="#connectionFactory" 
              transacted="jms"     
              concurrentConsumers="1"
              cacheLevel="3"
   />
   
   
   <jms:provider service="edddstub:jmsBulkOutService" 
              endpoint="bulkout"
              destinationName="DDD.BULK.RESP.Q"
              connectionFactory="#connectionFactory"
              replyDestinationName="DDD.BULK.RESP.Q"
              marshaler="#providerMarshaler"
   />
   
    <jms:provider service="edddstub:jmsNonBulkOutService" 
              endpoint="nonbulkout"
              destinationName="DDD.NON.BULK.RESP.Q"
              connectionFactory="#connectionFactory"  
              replyDestinationName="DDD.NON.BULK.RESP.Q"
              marshaler="#providerMarshaler"
   />

         <bean id="providerMarshaler"
class="com.symcor.eddd.publisher.DefaultProviderMarshaler" />  
 

Bean Component config:
<bean:endpoint service="edddstub:engineStubService" endpoint="endpoint"
                bean="#engineStubJBI" />
                
        <bean id="engineStubJBI"
                class="com.symcor.eddd.publisher.enginestub.EngineStubJBI">
                <property name="handler" ref="handler" />
                <property name="exceptionHandler" ref="exceptionHandler" />
        </bean>

And the java code for the bean:

@Override
        public void processMessageExchange(MessageExchange exchange)
                        throws ServiceException {
                try {
                        NormalizedMessage message = exchange.getMessage("in");
                        Source source = message.getContent();
                        if (source instanceof StringSource){
                                StringSource xmlSource = (StringSource) source;
                                UoW uow = 
UoWMarshalUtil.unmarshallString(xmlSource.getText());
                                UoW outUoW = handler.createOutUoW(uow);
                                String outString = 
UoWMarshalUtil.marshallUoW(outUoW);
                                Source outSource = new StringSource(outString);
                                // create the out message, send to service 
locator
                                NormalizedMessage outMessage = 
exchange.createMessage();
                                outMessage.setContent(outSource);
                                if 
(handler.isBulk(outUoW.getUoWContext().getServicesList())){
                                        logger.debug("Send result to JMS BULK 
RESPONSE Queue");
                                        jmsBulkOut.send(outMessage);
                                } else {
                                        logger.debug("Send result to JMS Non 
BULK RESPONSE Queue");
                                        jmsNonBulkOut.send(outMessage);
                                }
                        
                                exchange.setStatus(ExchangeStatus.DONE);
                                channel.send(exchange);
                                
                        } else {
                                throw new ServiceException("Invalid Message 
type, message is not xml");
                        }
                } catch (Exception e){
                        throw new ServiceException(e);
                }
        }

We are using the servicemix 3.3, Any suggestions.

-- 
View this message in context: 
http://www.nabble.com/Jms-Consumer-to-Bean-Components-to-Jms-Producer-tp22208877p22208877.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to