Hi all,

I have a pojo that returns a Map of Custom objects. In my camel context this
pojo is wired to receive requests from a jms (activemq) queue, i.e., it can
act as a simple service. Code below:

@Override
public Map<String, ParameterGroup> getParameterGroups() {
    return model.getParameterGroups();
}

I have a client which is a pojo producer (template injected using @Produce).
It invokes the service using the template.requestBody(Object) method. Code
below:

@Produce(uri = "activemq:requestParameterGroups")
ProducerTemplate requestParameterGroupsProducerTemplate;

@Override
public List<ParameterGroup> requestParameterGroups() {
    // testing service call
    List<ParameterGroup> parameterGroups = new ArrayList<ParameterGroup>();
    parameterGroups = (List<ParameterGroup>)
requestParameterGroupsProducerTemplate.requestBody(null);
    System.out.println("Received " + parameterGroups.size() + " parameter
groups.");
    return parameterGroups;
}

I have a question and an error. First the error:

The request makes it to the pojo service bean which attempts to return the
Map of custom objects but the return message times out. Looking at the logs
I can see a Camel runtime exception wrapping a spring jms
MessageFormatException which claims "Only objectified primitive objects,
String, Map, and List types are allowed but was...it then lists the entire
value part of the returned Map (Note, it does not print out the key)


On a side note: I assume the requestBody parameter Object can be null if you
don't need to send any parameters to the request, i.e., if the service
simply acts like a getter as in the case above.

Looks like the error is an activemq message. I can't find much info on it
other than it seems to occur when people attempt to put Objects in the
Header.

Thanks!

--
View this message in context: 
http://camel.465427.n5.nabble.com/MessageFormatException-using-requestBody-InOut-over-activemq-JMS-tp5554469p5554469.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to