Thanks a lot, it worked like a charm.
I added two fields to the config field (Username and Password) and read them
from the componet so they wouldn't be hardcoded. Here's the processor:
public class FixLoginRequestProcessor implements Processor
{
public void process(Exchange exchange) throws FieldNotFound, ConfigError
{
Message message = exchange.getIn().getBody(Message.class);
BeginString beginString = new BeginString();
SenderCompID senderCompID = new SenderCompID();
TargetCompID targetCompID = new TargetCompID();
message.getHeader().getField(beginString);
message.getHeader().getField(senderCompID);
message.getHeader().getField(targetCompID);
SessionID sessionID = new SessionID(beginString, senderCompID,
targetCompID);
SessionSettings sessionSettings = new
SessionSettings("receptor.cfg");
Properties properties =
sessionSettings.getSessionProperties(sessionID);
Username user = new
Username(properties.getProperty("Username"));
Password password = new
Password(properties.getProperty("Password"));
message.setField(user);
message.setField(password);
}
}
--
View this message in context:
http://camel.465427.n5.nabble.com/Quickfix-component-as-initiator-How-do-I-insert-user-and-password-to-logon-tp5726991p5727132.html
Sent from the Camel - Users mailing list archive at Nabble.com.