public EngsbMessage DoServiceCall(EngsbMessageBuilder builder) { this.log.Trace("Message abstractor used to send the message..."); this.worker.MessageToSend = builder.Finish(); return (EngsbMessage) this.nmsTemplate.Execute(this.worker, true); }
public EngsbMessage DoServiceCall(EngsbMessageBuilder builder, int timeout) { this.log.Trace("Message abstractor used to send the message..."); this.log.Info("Doing service call with [" + timeout + "]ms timeout..."); builder.SetReplyQueue(Guid.NewGuid().ToString()); this.messageId = builder.GetInnerMessage().MessageId; string toSend = builder.Finish(); this.log.Debug("Sending message to client"); this.nmsTemplate.SendWithDelegate( this.destination, delegate(ISession session) {return session.CreateTextMessage(toSend); }); lock(this) { Monitor.Wait(this); } if (this.response == null) throw new EngsbServiceException("Response message is null, because of a timeout..."); return this.response; }