私は、(Camelプロデューサテンプレートを使用して)ActiveMQキューにSolrInputDocment(Serializable)を追加しようとしていますが、MessageFormatExceptionを取得しました。ここActiveMQに追加されたときにSolrInputDocumentがMessageFormatExceptionをスローしていますか?
は私のコードです...ここ
SolrInputDocument doc1 = new SolrInputDocument();
doc1.addField("id", "1234", 1.0f);
template.sendBody("activemq:queue:test", doc1);
は私の誤りである...
Caused by: javax.jms.MessageFormatException: Only objectified primitive objects, String, Map and List types are allowed but was: id(1.0)={1234} type: class org.apache.solr.common.SolrInputField
UPDATE:問題は、私は明示的に 'オブジェクト' にJMSMessageTypeを設定する必要があるということです、それ以外の場合は、MapMessageが使用されます(カスタムタイプはサポートしていません)。
template.sendBodyAndHeader("activemq:queue:test", doc1, JMS_MESSAGE_TYPE, "Object");
http://stackoverflow.com/questions/9115971/bind-a-custom-object-to-a-jms-mapmessage –