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.19=10235=D34=8249=BANZAI52=20090511-06:51:3256=FIXGW11=124202469276821=138=15040=154=155=SUN59=010=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.19=10235=D34=8249=BANZAI52=20090...59=010=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.19=10235=D34=8249=BANZAI52=20090...59=010=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 ?
- Do I have to create in QuickFixConverter a method to handle this case ?

Regards,

Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

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

Reply via email to