trying to send the exchange when is active throws
java.lang.UnsupportedOperationException: Asynchonous send of active
exchanges are not supported
this is what i did:
DeliveryChannel channel = context.getDeliveryChannel();
InOnly exchange = channel.createExchangeFactory().createInOnlyExchange();
NormalizedMessage message = exchange.createMessage();
exchange.setInMessage(message);
message.setProperty("id", new Integer(1));
message.setContent(new StringSource("<example id='" + 1 + "'/>"));
log.debug("status="+exchange.getStatus().toString());
exchange.setStatus(ExchangeStatus.ACTIVE);
channel.send(exchange);
log.debug("sent");
----- Original Message -----
From: "Guillaume Nodet" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, June 14, 2006 11:42 AM
Subject: Re: javax.jbi.messaging.MessagingException: illegal exchange
status: done
When you create and send a jbi exchange, the status must be ACTIVE.
For an InOnly mep, the provider (the target component) will send it back
with a DONE status.
Cheers,
Guillaume Nodet
On 6/14/06, Alessandro Fredianelli <[EMAIL PROTECTED]>
wrote:
why doing this on a jsr181 exposed pojo
DeliveryChannel channel = context.getDeliveryChannel();
InOnly exchange = channel.createExchangeFactory().createInOnlyExchange();
NormalizedMessage message = exchange.createMessage();
exchange.setInMessage(message);
message.setProperty("id", new Integer(1));
message.setContent(new StringSource("<example id='" + 1 + "'/>"));
exchange.setStatus(ExchangeStatus.DONE);
channel.send(exchange);
log.debug("sent");
throws javax.jbi.messaging.MessagingException: illegal exchange status:
done ?