@Transactional @Test public void testMessageSendToConsumerQueueRemoteId() throws Exception { Status status = new Status(); status.setUserId(10); statusDAO.save(status); Endpoint mockEndpoint = this.context.getEndpoint(properties.getProperty("activemq.destination")); PollingConsumer consumer = mockEndpoint.createPollingConsumer(); producerTemplate.sendBodyAndHeader(source, "<?xml version='1.0' encoding='UTF-8' standalone='yes'?><example><remoteid>10</remoteid></example>","disableReplyTo","true"); Status savedStatus = consumer.receive(100).getIn().getBody(Status.class); logger.info("savedStatus "+savedStatus.getID()+" "+savedStatus.getUserId()); assertNotNull(savedStatus); }