Hi Guys,

I have the following Java DSL:

from(queuePrefix + fileType + "_ValidQ?concurrentConsumers=100")
.routeId(fileType + "_ValidQ-To-DB")
.onException(Exception.class).redeliveryPolicyRef("redeliverypolicy")
.to(queuePrefix + fileType + "_DBLoading_ErrorQ").end()
.aggregate(header("CRBOriginalFileName"))
.completionSize(5000)
.parallelProcessing()
.groupExchanges()
.to("bean:keBouncedChequeLoader");

The destination is a bean. The bean is as shown below:

public void process(Exchange exchange) throws Exception {
List<Exchange> exchanges = exchange.getProperty(Exchange.GROUPED_EXCHANGE,
List.class);
Session session = SessionFactoryUtils.getSession(sessionFactory, true);
Transaction tx = session.beginTransaction();
 for(int i = 0; i < exchanges.size(); i++) {
KEBouncedCheque bc = (KEBouncedCheque) exchanges.get(i).getIn().getBody();
session.save(exchanges.get(i));
FileUtils.writeStringToFile(new File("C:/tmp/bc.txt"), bc.getClientNumber()
+ "\n", true);
if( i % 20 == 0) {
session.flush();
session.clear();
}
}
 tx.commit();
session.close();
 }

The message doesn't seem to reach this bean. In ActiveMQ, I'm seeing the
error

"Unknown message type [org.apache.activemq.command.ActiveMQMessage]"...

I'm not sure what I'm doing wrong. Any assistance will be appreciated very
much.

Kind Regards,
Okello Nelson.

Reply via email to