예제 #1
0
파일: Channel.cs 프로젝트: skovsende/jasper
 public Channel(CompositeMessageLogger logger, SubscriberAddress address, Uri replyUri, ISendingAgent agent)
 {
     LocalReplyUri = replyUri;
     _logger       = logger;
     _address      = address;
     _agent        = agent;
 }
        public when_building_an_envelope_for_scheduled_send()
        {
            theOriginal = ObjectMother.Envelope();
            theOriginal.ExecutionTime = DateTime.UtcNow.Date.AddDays(2);
            theOriginal.Destination   = "tcp://server3:2345".ToUri();

            theSubscriber = Substitute.For <ISendingAgent>();

            theScheduledEnvelope = theOriginal.ForScheduledSend(theSubscriber);
        }
예제 #3
0
        public StaticRoute(ISendingAgent agent,
                           WriterCollection <IMessageSerializer> writers, MessageTypeRouting routing)
        {
            _agent    = agent;
            _endpoint = agent.Endpoint;
            _writers  = writers;
            _routing  = routing;
            // TODO -- select the right serializer for the endpoint
            // hard-coding to JSON for now

            _writer = writers.ChooseWriter("application/json");
        }
예제 #4
0
 public static Envelope ForScheduledSend(this Envelope envelope, ISendingAgent sender)
 {
     return(new Envelope(envelope, EnvelopeReaderWriter.Instance)
     {
         Message = envelope,
         MessageType = TransportConstants.ScheduledEnvelope,
         ExecutionTime = envelope.ExecutionTime,
         ContentType = TransportConstants.SerializedEnvelope,
         Destination = TransportConstants.DurableLocalUri,
         Status = EnvelopeStatus.Scheduled,
         OwnerId = TransportConstants.AnyNode,
         Sender = sender,
         Data = envelope.Serialize()
     });
 }
예제 #5
0
        public void AddStaticRoute(ISendingAgent agent)
        {
            var route = new StaticRoute(agent, Writers, this);

            _routes.Add(route);
        }
예제 #6
0
 public void AddSendingAgent(ISendingAgent sendingAgent)
 {
     _senders = _senders.AddOrUpdate(sendingAgent.Destination, sendingAgent);
 }
예제 #7
0
파일: Channel.cs 프로젝트: skovsende/jasper
 public Channel(CompositeMessageLogger logger, ISendingAgent agent, Uri replyUri)
     : this(logger, new SubscriberAddress(agent.Destination), replyUri, agent)
 {
 }
예제 #8
0
 public void StartSending(IMessageLogger logger, ISendingAgent agent, Uri replyUri)
 {
     ReplyUri = replyUri;
     _logger  = logger;
     _agent   = agent;
 }
예제 #9
0
 public EnvelopeRouter(IMessagingRoot root)
 {
     _root = root;
     _durableLocalQueue = root.Runtime.GetOrBuildSendingAgent(TransportConstants.DurableLocalUri);
 }
예제 #10
0
 public void Start(IPersistence persistence, IWorkerQueue workers)
 {
     _durable     = persistence.BuildLocalAgent(TransportConstants.DurableLoopbackUri, workers);
     _lightweight = new LoopbackSendingAgent(TransportConstants.LoopbackUri, workers);
 }
예제 #11
0
 public Channel(ISendingAgent agent, Uri replyUri)
     : this(new SubscriberAddress(agent.Destination), replyUri, agent)
 {
 }
예제 #12
0
 public Channel(SubscriberAddress address, Uri replyUri, ISendingAgent agent)
 {
     LocalReplyUri = replyUri;
     _address      = address;
     _agent        = agent;
 }
예제 #13
0
 public void Start(IMessagingRoot root)
 {
     _durable     = root.BuildDurableLoopbackAgent(TransportConstants.DurableLoopbackUri);
     _lightweight = new LoopbackSendingAgent(TransportConstants.LoopbackUri, root.Workers);
 }