final String address = to.getValue();
LOG.fine("Resending to address: " + address);
final Endpoint reliableEndpoint = manager.getReliableEndpoint(message).getEndpoint();
ConduitSelector cs = new DeferredConduitSelector() {
@Override
public synchronized Conduit selectConduit(Message message) {
Conduit conduit = null;
EndpointInfo endpointInfo = reliableEndpoint.getEndpointInfo();
org.apache.cxf.ws.addressing.EndpointReferenceType original =
endpointInfo.getTarget();
try {
if (null != address) {
endpointInfo.setAddress(address);
}
conduit = super.selectConduit(message);
} finally {
endpointInfo.setAddress(original);
}
return conduit;
}
};
cs.setEndpoint(reliableEndpoint);
Conduit c = cs.selectConduit(message);
// REVISIT
// use application endpoint message observer instead?
c.setMessageObserver(new MessageObserver() {
public void onMessage(Message message) {
LOG.fine("Ignoring response to resent message.");