endPoints = endPoints;
}
protected boolean transform(MessageExchange exchange,
NormalizedMessage in, NormalizedMessage out)
throws MessagingException
{
String correlationId = (String)exchange.getProperty(
Constants.CORRELATION_ID_KEY);
System.out.println("CreditGateway.transform.correlationId
: " + correlationId);
out.setProperty(Constants.RECIPIENTS_KEY, getRecipients());
return true;
}
private QName[] getRecipients()
{
QName[] recipients = new QName[endPoints.size()];
String theNamespaceURI = null;
String theLocalPart = null;
int times = 0;
for(Iterator iterator = endPoints.keySet().iterator();
iterator.hasNext();)
{
theLocalPart = (String) iterator.next();
theNamespaceURI = (String) endPoints.get(theLocalPart);
recipients[times++] = new QName(theNamespaceURI,
theLocalPart);
}
return recipients;
}
}
Here we generate a static recipient list. The recipient list is configured in the
servicemix.xml file for the Credit Gateway component as shown here:
endpoint="creditGateWay"
service="binil:creditGateWay">
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474