Hi All,

I have a simple camel route where a ActiveMQBlobMessage is created and put
into a JMS endpoint and then passed to a file endpoint to be written to a
file.

I have the following spring-camel configuration:

<bean id="connectionFactory"
class="org.apache.activemq.pool.PooledConnectionFactory">
        <constructor-arg
value="vm://localhost:40016?jms.blobTransferPolicy.uploadUrl=ftp://user:passw...@localhost/archive/";
/>
              <property name="maxConnections" value="16" />
</bean>

<camelContext trace="true" id="blob_message_route" xmlns="
http://camel.apache.org/schema/spring";>
        <route>
            <!-- <from uri="activemq:queue:in.q?messageConverter=#converter"
/> -->
            <from uri="activemq:queue:in.q" />
            <to
uri="file:///c:/temp/?fileName=result-${date:now:yyyyMMddHHmmssSSS}.txt" />
        </route>
</camelContext>

I have also created a custom type converter which converts from BlobMessage
to InputStream and added a fall back converter to it as well. I have exposed
this converter as a separate OSGi service. When the run time starts then the
service is properly registered and is active. When i put a break point in
activator the custom converter is picked up properly and registered.

However JmsBinding fails to create message body as there is no inherent
support for ActiveMQBlobMessage (understandably since it is not a part of
standard JMS spec) however a plug should have been provided for custom types
here so that a body could be created.

It finally looks for StreamCache to JmsMessage converter which it cannot
find. I am not sure yet where StreamCache comes from because in this route i
only need an InputStream outbound and not a StreamCache. Since is not able
to find a converter it fails as well.

There is only one way i could make the ActiveMQBlobMessage work and that is
by creating a custom MessageConverter and registering it on the URI (which
in my opinion is not a proper way of doing it) - <from
uri="activemq:queue:in.q?messageConverter=#converter" />

Where does the type converter get picked up from the TypeConverterRegistry?
I will put some break points in DefaultTypeConverter as that is the only
implementation of TypeConverterRegistry i could locate and check how i can
make camel recognize the custom type converter.

Any help would be really appreciated.


Best Regards,
Madhav


-- 
When I tell the truth, it is not for the sake of convincing those who do not
know it, but for the sake of defending those that do

Reply via email to