To close out this thread, here is the solution. Because Camel does not know
that the consumer on the other end is NOT Camel, it wraps the @Produce into
a BeanInvocation object. Using the convertBodyTo, I am able to tell Camel
to convert from BeanInvocation to the value of the first parameter. Then,
after converting the message to JSON using Jackson, I once again tell Camel
to convert the message to a String. Thus a text message is sent over the
STOMP connection and it gets to the browser via WebSocket as expected.
Here is the solution to the route issue I was having:
<camel:camelContext>
<camel:route>
<camel:from uri="direct:gozing/engine/user" />
<camel:convertBodyTo
type="com.usamp.gozing.engine.messaging.event.Event" />
<camel:setHeader headerName="userId">
<camel:simple resultType="java.lang.Integer">
${body.userId}
</camel:simple>
</camel:setHeader>
<camel:marshal>
<camel:json library="Jackson"/>
</camel:marshal>
<camel:convertBodyTo type="java.lang.String" />
<camel:recipientList>
<camel:simple resultType="java.lang.String">
stomp:topic:dm${in.header.userId}
</camel:simple>
</camel:recipientList>
</camel:route>
</camel:camelContext>
Not sure if Header is a proper way to pass parameters/values between route
components, however.
-AP_
--
View this message in context:
http://camel.465427.n5.nabble.com/Messages-seem-to-contain-more-than-I-expected-tp5738325p5738353.html
Sent from the Camel - Users mailing list archive at Nabble.com.