Claus,

Here is what I created :

    @Converter
    public static Message toMessage(String message) throws IOException,
InvalidMessage {
        return new Message(message);
    }

in the class QuickFixConverter but the same error is reported

Regards,

Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

*****************************
blog : http://cmoulliard.blogspot.com


On Mon, May 11, 2009 at 9:25 AM, Claus Ibsen <claus.ib...@gmail.com> wrote:

> On Mon, May 11, 2009 at 9:16 AM, Charles Moulliard <cmoulli...@gmail.com>
> wrote:
> > Hi,
> >
> > I have created the following camel routes where my messages received from
> > the FIX server are placed in a queue.
> >
> >        <camel:route>
> >            <camel:from
> uri="quickfix-server:META-INF/examples/server.cfg"/>
> >            <camel:convertBodyTo type="java.lang.String"/>
> >            <camel:to uri="queuingservice:queue:fix"/>
> >        </camel:route>
> >        <camel:route>
> >            <camel:from uri="queuingservice:queue:fix"/>
> >            <camel:convertBodyTo type="quickfix.Message"/>
> >            <camel:to uri="quickfix-client:META-INF/examples/client.cfg"/>
> >        </camel:route>
> >
> > When the messages are read from the queue and converted, the following
> error
> > is reported.
> >
> > 08:51:36,515 | INFO  | enerContainer-23 | TraceInterceptor
>   |
> > rg.apache.camel.processor.Logger  127 |
> > ID-dell-charles-1611-1242019089609-2-5 >>>
> > to(quickfix-client:META-INF/examples/client.cfg) -->
> > to(quickfix-client:META-INF/examples/client.cfg), Pattern:InOut,
> >
> Properties:{JMSReplyTo=temp-queue://ID:dell-charles-1607-1242019074921-2:2:1},
> > Headers:{JMSXGroupID=null,
> > JMSCorrelationID=ID-dell-charles-1611-1242019089609-3-0, JMSType=null,
> > JMSExpiration=1242024716484,
> > JMSMessageID=ID:dell-charles-1607-1242019074921-2:2:3:1:1,
> > JMSRedelivered=false, JMSDeliveryMode=2, JMSPriority=4,
> > JMSReplyTo=temp-queue://ID:dell-charles-1607-1242019074921-2:2:1,
> > JMSTimestamp=1242024696484, JMSDestination=queue://fix}, BodyType:String,
> > Body:8=FIX.4.1 9=102 35=D 34=82 49=BANZAI 52=20090511-06:51:32 56=FIXGW
> 11=1242024692768 21=1 38=150 40=1 54=1 55=SUN 59=0 10=051
> > 08:51:36,515 | ERROR | enerContainer-23 | DeadLetterChannel
>  |
> > rg.apache.camel.processor.Logger  207 | Failed delivery for exchangeId:
> > ID:dell-charles-1607-1242019074921-2:2:3:1:1. On delivery attempt: 0
> caught:
> > org.apache.camel.NoTypeConversionAvailableException: No type converter
> > available to convert from type: org.apache.camel.component.jms.JmsMessage
> to
> > the required type: quickfix.Message with value JmsMessage:
> > ActiveMQTextMessage {commandId = 10, responseRequired = true, messageId =
> > ID:dell-charles-1607-1242019074921-2:2:3:1:1, originalDestination = null,
> > originalTransactionId = null, producerId =
> > ID:dell-charles-1607-1242019074921-2:2:3:1, destination = queue://fix,
> > transactionId = null, expiration = 1242024716484, timestamp =
> 1242024696484,
> > arrival = 0, brokerInTime = 1242024696484, brokerOutTime = 1242024696500,
> > correlationId = ID-dell-charles-1611-1242019089609-3-0, replyTo =
> > temp-queue://ID:dell-charles-1607-1242019074921-2:2:1, persistent = true,
> > type = null, priority = 4, groupID = null, groupSequence = 0,
> > targetConsumerId = null, compressed = false, userID = null, content =
> null,
> > marshalledProperties = null, dataStructure = null, redeliveryCounter = 0,
> > size = 0, properties = null, readOnlyProperties = true, readOnlyBody =
> true,
> > droppable = false, text =
> > 8=FIX.4.1 9=102 35=D 34=82 49=BANZAI 52=20090...59=0 10=051 }
> > org.apache.camel.NoTypeConversionAvailableException: *No type converter
> > available to convert from type: org.apache.camel.component.jms.JmsMessage
> to
> > the required type: quickfix.Message* with value JmsMessage:
> > ActiveMQTextMessage {commandId = 10, responseRequired = true, messageId =
> > ID:dell-charles-1607-1242019074921-2:2:3:1:1, originalDestination = null,
> > originalTransactionId = null, producerId =
> > ID:dell-charles-1607-1242019074921-2:2:3:1, destination = queue://fix,
> > transactionId = null, expiration = 1242024716484, timestamp =
> 1242024696484,
> > arrival = 0, brokerInTime = 1242024696484, brokerOutTime = 1242024696500,
> > correlationId = ID-dell-charles-1611-1242019089609-3-0, replyTo =
> > temp-queue://ID:dell-charles-1607-1242019074921-2:2:1, persistent = true,
> > type = null, priority = 4, groupID = null, groupSequence = 0,
> > targetConsumerId = null, compressed = false, userID = null, content =
> null,
> > marshalledProperties = null, dataStructure = null, redeliveryCounter = 0,
> > size = 0, properties = null, readOnlyProperties = true, readOnlyBody =
> true,
> > droppable = false, text =
> > 8=FIX.4.1 9=102 35=D 34=82 49=BANZAI 52=20090...59=0 10=051 }
> >    at
> >
> org.apache.camel.impl.converter.DefaultTypeConverter.doConvertTo(DefaultTypeConverter.java:155)
> >    at
> >
> org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:98)
> >    at
> >
> org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:94)
> >    at
> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:86)
> >    at
> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:52)
> >    at
> >
> org.apache.camel.util.ExchangeHelper.getMandatoryInBody(ExchangeHelper.java:135)
> >
> > Questions :
> >
> > - Do I have to get the body from the JmsMessage before to call
> convertBody ?
> No
>
> > - Do I have to create in QuickFixConverter a method to handle this case ?
> Yes. You have put a String message on the JMS queue.
> And when you consume this message from the JMS queue you try to
> convert it to a FixMessage.
>
> This is the route you do
>         <camel:route>
>            <camel:from uri="queuingservice:queue:fix"/>
>            <camel:convertBodyTo type="quickfix.Message"/>
>            <camel:to uri="quickfix-client:META-INF/examples/client.cfg"/>
>        </camel:route>
>
> And what is needed is a String -> FixMessage TypeConverter.
>
> Usually you create a method in FixConverter (or what the class was
> named) and define a method like
>
> @Converter
> FixMessage toFixMessage(String body, Exchange exchange) {
>  ... do the convertions here
> }
>
>
> See more about type converter here:
> http://camel.apache.org/type-converter.html
>
> >
> > Regards,
> >
> > Charles Moulliard
> > Senior Enterprise Architect
> > Apache Camel Committer
> >
> > *****************************
> > blog : http://cmoulliard.blogspot.com
> >
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
> Apache Camel Reference Card:
> http://refcardz.dzone.com/refcardz/enterprise-integration
> Interview with me:
>
> http://architects.dzone.com/articles/interview-claus-ibsen-about?mz=7893-progress
>

Reply via email to