Question

We have a requirement where we are trying to send a huge xml payload from an activemq queue to an oracle aq queue using Camel.

The payload is more than 4000 bytes. So, Camel cannot send this message across as Oracleaq tried to convert this message to a VARCHAR which has a limit of 4000 charecters.

So, how do we pass these huge payloads to Oracle. Do I have to set something in camel so that message is handed over to oracle as a 'CLOB' instead of a 'VARCHAR'? or is it something that needs to be done on oracle's side?

Was it helpful?

Solution

Apache Camel uses Spring JMS in the camel-jms component, so it support what JMS can do. So if Oracle AMQ has a limitation about 4000 bytes or something, its something you need to handle on the Oracle side.

Basically Camel uses JMS and you need to dive into the Oracle AMQ docs to figure out its JMS interop.

JMS has different message types: Text, Bytes, Map, Object etc. For XML you may need to use either Bytes or Text. You can configure the jmsMessageType on the JMS endpoint in Camel to force a specific type. If not then Camel picks the most appropriate based on the message body type. Eg string => Text etc.

There are other users of Apache Camel that has integrated with Oracle AMQ so it should be possible.

OTHER TIPS

You could try using the convertBodyTo method before sending to Oracle:

https://camel.apache.org/convertbodyto.html

If you are using the "buffered messaging" feature of Oracle AQ, the size can't go beyond 4000 bytes, as stated here in the specs:

http://docs.oracle.com/cd/E11882_01/server.112/e11013/jm_create.htm#ADQUE2891

If you're not using buffered messaging, OracleAQ should handle conversion to VARCHAR2 or CLOB automatically, depending on message size as far as I understand

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top