/// <summary>
		/// Create a default local queue polling node factory
		/// <para>You should not use this yourself. Use:</para>
		/// <para>MessagingSystem.Configure.WithLocalQueue(...);</para>
		/// </summary>
		public LocalQueuePollingNodeFactory(LocalQueueConfig config,
		                                    IMessageSerialiser serialiser, ISleepWrapper sleeper)
		{
			_serialiser = serialiser;
			_sleeper = sleeper;
			_dispatchPath = config.DispatchPath;
			_incomingPath = config.IncomingPath;
		}
        public void When_setting_up_a_named_destination()
        {
            typeRouter = Substitute.For<ITypeRouter>();
            messageRouter = Substitute.For<IMessageRouter>();
            serialiser = Substitute.For<IMessageSerialiser>();

            messaging = new MessagingBase(typeRouter, messageRouter, serialiser);
            messaging.ResetCaches();
        }
        /// <summary>
        /// Use HTTP transportation for this <see cref="IServiceBus"/> using the a predefined HTTP client.
        /// </summary>
        /// <param name="hostAddressConfiguration">The <see cref="IHostAddressConfiguration"/>.</param>
        /// <param name="client">The HTTP client to use.</param>
        /// <param name="messageSerialiser">The <see cref="IMessageSerialiser"/> to use.</param>
        /// <returns>The <see cref="ITransportConfiguration"/>.</returns>
        public static ITransportConfiguration WithHttpTransport(this IHostAddressConfiguration hostAddressConfiguration, HttpClient client, IMessageSerialiser messageSerialiser)
        {
            Argument.CannotBeNull(client, "client", "The HTTP transporter cannot accept a null HTTP Client.");
            Argument.CannotBeNull(messageSerialiser, "messageSerialiser", "A message serialiser to be used by the transporter cannot be null.");

            var transporter = new HttpTransporter(client, messageSerialiser);

            return new TransportConfiguration(hostAddressConfiguration, transporter);
        }
		/// <summary>
		/// Create a local polling node.
		/// <para>You should not use this yourself. Use:</para>
		/// <para>MessagingSystem.Configure.WithLocalQueue(...);</para>
		/// and receive messages as normal.
		/// </summary>
		public LocalQueuePollingNode(string dispatchPath, string incomingPath,
		                             IMessageSerialiser serialiser, ISleepWrapper sleeper)
		{
			_dispatchPath = dispatchPath;
			_incomingPath = incomingPath;
			_serialiser = serialiser;
			_sleeper = sleeper;
			_boundMessageTypes = new ConcurrentSet<Type>();
		}
        public void When_setting_up_a_named_destination()
        {
            typeRouter = Substitute.For<ITypeRouter>();
            messageRouter = Substitute.For<IMessageRouter>();
            serialiser = Substitute.For<IMessageSerialiser>();

            messaging = new MessagingBase(typeRouter, messageRouter, serialiser);
            messaging.ResetCaches();
            messaging.CreateDestination<IMetadataFile>("MyServiceDestination");
        }
        /// <summary>
        /// Use FTP transportation for this <see cref="IServiceBus"/> using the a predefined FTP client factory.
        /// </summary>
        /// <param name="hostAddressConfiguration">The <see cref="IHostAddressConfiguration"/>.</param>
        /// <param name="clientFactory">The FTP client factory to use.</param>
        /// <param name="messageSerialiser">The <see cref="IMessageSerialiser"/> to use.</param>
        /// <param name="pathToReciever">The full file path of the location this peers FTP server is mapped to receive messages.</param>
        /// <returns>The <see cref="ITransportConfiguration"/>.</returns>
        public static ITransportConfiguration WithFtpTransport(this IHostAddressConfiguration hostAddressConfiguration, IFtpClientFactory clientFactory, IMessageSerialiser messageSerialiser, string pathToReciever)
        {
            Argument.CannotBeNull(clientFactory, "clientFactory", "The FTP transporter cannot accept a null FTP Client Factory.");
            Argument.CannotBeNull(messageSerialiser, "messageSerialiser", "A message serialiser to be used by the transporter cannot be null.");
            Argument.CannotBe(pathToReciever, "pathToReciever", path => !string.IsNullOrEmpty(path));

            var transporter = new FtpTransporter(clientFactory, messageSerialiser, pathToReciever);

            return new TransportConfiguration(hostAddressConfiguration, transporter);
        }
        public void setup()
        {
            source = new UltraMegaData
            {
                CorrelationId = Guid.Parse("05C90FEB-5C10-4179-9FC0-D26DDA5FD1C6"),
                FilePath = "C:\\work\\message",
                HashValue = 123124512
            };

            subject = new MessageSerialiser();
        }
 public void SetUp()
 {
     subject = new MessageSerialiser();
     originalObject = new SuperMetadata
         {
             CorrelationId = Guid.Parse("05C90FEB-5C10-4179-9FC0-D26DDA5FD1C6"),
             Contents = "My message contents",
             FilePath = "C:\\work\\message",
             HashValue = 123124512,
             MetadataName = "Mind the gap"
         };
     message = subject.Serialise(originalObject);
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Initialises a new instance of the <see cref="FtpTransporter"/> class.
        /// </summary>
        /// <param name="clientFactory">The <see cref="FtpMessageSender"/> to use to send messages.</param>
        /// <param name="messageSerialiser">The <see cref="IMessageSerialiser"/> to use.</param>
        /// <param name="pathToReciever">The full file path of the location this peers FTP server is mapped to receive messages.</param>
        public FtpTransporter(IFtpClientFactory clientFactory, IMessageSerialiser messageSerialiser, string pathToReciever)
        {
            this._clientFactory = clientFactory;
            this._serialiser = messageSerialiser;
            this._messageRecievedWatcher = new FileSystemWatcher(pathToReciever, "*.msg")
                                           {
                                               NotifyFilter = NotifyFilters.LastWrite
                                           };

            this._messageRecievedWatcher.Changed += async (sender, args) => await this.MessageReceived(sender, args);

            this._messageRecievedWatcher.EnableRaisingEvents = true;
        }
 public void SetUp()
 {
     subject = new MessageSerialiser();
     originalObject = new SuperMetadata
         {
             CorrelationId = Guid.Parse("05C90FEB-5C10-4179-9FC0-D26DDA5FD1C6"),
             Contents = "My message contents",
             FilePath = "C:\\work\\message",
             HashValue = 123124512,
             MetadataName = "Mind the gap"
         };
     message = subject.Serialise(originalObject).Replace("Example.Types.IMetadataFile, Example.Types", "Pauls.IMum, Phils.Face");
     Console.WriteLine(message);
 }
        public void When_setting_up_a_named_destination()
        {
            metadataMessage = new SuperMetadata();

            badMessage = new {Who="What"};
            typeRouter = Substitute.For<ITypeRouter>();
            messageRouter = Substitute.For<IMessageRouter>();
            serialiser = Substitute.For<IMessageSerialiser>();
            serialiser.Serialise(metadataMessage).Returns(serialisedObject);

            messaging = new MessagingBase(typeRouter, messageRouter, serialiser);
            messaging.ResetCaches();
            messaging.SendMessage(metadataMessage);
        }
        public void With_string_serialised_from_a_source_object()
        {
            source = new SuperMetadata
            {
                CorrelationId = Guid.Parse("05C90FEB-5C10-4179-9FC0-D26DDA5FD1C6"),
                Contents = "My message contents",
                FilePath = "C:\\work\\message",
                HashValue = 123124512,
                MetadataName = "Mind the gap"
            };

            subject = new MessageSerialiser();
            result = subject.Serialise(source);
            Console.WriteLine(result);
        }
Ejemplo n.º 13
0
        public void SetupBeforeEachTest()
        {
            this.channelManagerFactory = A.Fake<IChannelManagerFactory>();
             this.messageHandlerTypesIndexFactory = A.Fake<IMessageHandlerTypesIndexFactory>();
             this.messageHandlerInvokerFactory = A.Fake<IMessageHandlerInvokerFactory>();
             this.queueNameConvention = A.Fake<IQueueNameConvention>();
             this.messageEncoder = A.Fake<IMessageEncoder>();
             this.messageSerialiser = A.Fake<IMessageSerialiser>();
             this.logger = A.Fake<ILogger>();
             this.configuration = A.Fake<IConfiguration>();
             this.channelManager = A.Fake<IChannelManager>();
             this.channel = A.Fake<IModel>();

             A.CallTo(() => this.channelManagerFactory.Create()).Returns(this.channelManager);
             A.CallTo(() => this.channelManager.CreateChannel()).Returns(this.channel);

             this.componentUnderTest = new RabbitMQMessageListener(this.channelManagerFactory, new Type[0], this.messageHandlerTypesIndexFactory, this.messageHandlerInvokerFactory, this.queueNameConvention, this.messageEncoder, this.messageSerialiser, this.logger, this.configuration);
        }
 public RabbitMQMessageSubscriptionFactory(
  IMessageHandlerTypesIndexFactory messageHandlerTypesIndexFactory,
  IMessageHandlerInvokerFactory messageHandlerInvokerFactory,
  ITaskLibrary taskLibrary,
  IQueueNameConvention queueNameConvention,
  IMessageEncoder messageEncoder,
  IMessageSerialiser messageSerialiser,
  ILogger logger,
  IConfiguration configuration)
 {
     this.messageHandlerTypesIndexFactory = messageHandlerTypesIndexFactory;
      this.messageHandlerInvokerFactory = messageHandlerInvokerFactory;
      this.taskLibrary = taskLibrary;
      this.queueNameConvention = queueNameConvention;
      this.messageEncoder = messageEncoder;
      this.messageSerialiser = messageSerialiser;
      this.logger = logger;
      this.configuration = configuration;
 }
 public RabbitMQMessageListener(
  IChannelManagerFactory channelManagerFactory,
  Type[] messageHandlerTypes,
  IMessageHandlerTypesIndexFactory messageHandlerTypesIndexFactory,
  IMessageHandlerInvokerFactory messageHandlerInvokerFactory,
  IQueueNameConvention queueNameConvention,
  IMessageEncoder messageEncoder,
  IMessageSerialiser messageSerialiser,
  ILogger logger,
  IConfiguration configuration)
 {
     this.channelManager = channelManagerFactory.Create();
      this.queueNameConvention = queueNameConvention;
      this.messageEncoder = messageEncoder;
      this.messageSerialiser = messageSerialiser;
      this.logger = logger;
      this.configuration = configuration;
      this.messageHandlerTypesIndex = messageHandlerTypesIndexFactory.Create(messageHandlerTypes);
      this.messageHandlerInvoker = messageHandlerInvokerFactory.CreateAggregate(this.messageHandlerTypesIndex);
 }
Ejemplo n.º 16
0
 public TypeSerialiser(Type type, IMessageSerialiser serialiser)
 {
     Type = type;
     Serialiser = serialiser;
 }
Ejemplo n.º 17
0
        /// <summary>
        /// Initiates an instance of <see cref="SqlSagaRepository"/> with a connection string name.
        /// Actual connection string is taken from your app.config or web.config
        /// </summary>
        /// <param name="connectionFactory">An insantance implementing <see cref="IConnectionFactory"/></param>
        /// <param name="sagaFactory">An instance implementing <see cref="ISagaFactory"/></param>
        /// <param name="messageSerialiser">An instance implementing <see cref="IMessageSerialiser"/></param>
        public SqlSagaRepository(ISagaSqlDatabase database, ISagaFactory sagaFactory, IMessageSerialiser messageSerialiser)
        {
            Guard.ArgumentIsNotNull(database, nameof(database));
            Guard.ArgumentIsNotNull(sagaFactory, nameof(sagaFactory));
            Guard.ArgumentIsNotNull(messageSerialiser, nameof(messageSerialiser));

            this.messageSerialiser = messageSerialiser;
            this.sagaFactory       = sagaFactory;
            this.database          = database;
        }
 /// <summary>
 /// Instantiates a new instance of <see cref="AzureCommandBusReceiver{TAuthenticationToken}"/>.
 /// </summary>
 public AzureCommandBusReceiver(IConfigurationManager configurationManager, IMessageSerialiser <TAuthenticationToken> messageSerialiser, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, IHashAlgorithmFactory hashAlgorithmFactory, IAzureBusHelper <TAuthenticationToken> azureBusHelper)
     : base(configurationManager, messageSerialiser, authenticationTokenHelper, correlationIdHelper, logger, hashAlgorithmFactory, azureBusHelper, false)
 {
     TelemetryHelper = configurationManager.CreateTelemetryHelper("Cqrs.Azure.EventHub.CommandBus.Receiver.UseApplicationInsightTelemetryHelper", correlationIdHelper);
 }
 /// <summary>
 /// Use FTP transportation for this <see cref="IServiceBus"/> using the default FTP client factory.
 /// </summary>
 /// <param name="hostAddressConfiguration">The <see cref="IHostAddressConfiguration"/>.</param>
 /// <param name="messageSerialiser">The <see cref="IMessageSerialiser"/> to use.</param>
 /// <param name="pathToReciever">The full file path of the location this peers FTP server is mapped to receive messages.</param>
 /// <returns>The <see cref="ITransportConfiguration"/>.</returns>
 public static ITransportConfiguration WithFtpTransport(this IHostAddressConfiguration hostAddressConfiguration, IMessageSerialiser messageSerialiser, string pathToReciever)
 {
     return hostAddressConfiguration.WithFtpTransport(new FtpClientFactory(), messageSerialiser, pathToReciever);
 }
Ejemplo n.º 20
0
 /// <summary>
 /// Instantiates a new instance of <see cref="AzureEventBusReceiver{TAuthenticationToken}"/>.
 /// </summary>
 public AzureEventBusReceiver(IConfigurationManager configurationManager, IMessageSerialiser <TAuthenticationToken> messageSerialiser, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, IAzureBusHelper <TAuthenticationToken> azureBusHelper, IBusHelper busHelper)
     : base(configurationManager, messageSerialiser, authenticationTokenHelper, correlationIdHelper, logger, azureBusHelper, busHelper, false)
 {
     TelemetryHelper = configurationManager.CreateTelemetryHelper("Cqrs.Azure.EventBus.Receiver.UseApplicationInsightTelemetryHelper", correlationIdHelper);
 }
 protected override void When()
 {
     _result = SystemUnderTest.GetSerialiser <GenericMessage>();
 }
Ejemplo n.º 22
0
 /// <summary>
 /// Instantiates a new instance of <see cref="AzureQueuedCommandBusReceiver{TAuthenticationToken}"/>.
 /// </summary>
 public AzureQueuedCommandBusReceiver(IConfigurationManager configurationManager, IMessageSerialiser <TAuthenticationToken> messageSerialiser, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, IAzureBusHelper <TAuthenticationToken> azureBusHelper, IBusHelper busHelper, IHashAlgorithmFactory hashAlgorithmFactory)
     : base(configurationManager, messageSerialiser, authenticationTokenHelper, correlationIdHelper, logger, azureBusHelper, busHelper, hashAlgorithmFactory)
 {
     QueueTracker     = new ConcurrentDictionary <string, ConcurrentQueue <ICommand <TAuthenticationToken> > >();
     QueueTrackerLock = new ReaderWriterLockSlim();
 }
Ejemplo n.º 23
0
        protected AzureBus(IConfigurationManager configurationManager, IBusHelper busHelper, IMessageSerialiser <TAuthenticationToken> messageSerialiser, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, bool isAPublisher)
        {
            EventWaits = new ConcurrentDictionary <Guid, IList <IEvent <TAuthenticationToken> > >();

            MessageSerialiser         = messageSerialiser;
            AuthenticationTokenHelper = authenticationTokenHelper;
            CorrelationIdHelper       = correlationIdHelper;
            Logger               = logger;
            BusHelper            = busHelper;
            ConfigurationManager = configurationManager;
            ConnectionString     = ConfigurationManager.GetSetting(MessageBusConnectionStringConfigurationKey);

            NamespaceManager namespaceManager = NamespaceManager.CreateFromConnectionString(ConnectionString);

            if (isAPublisher)
            {
                InstantiatePublishing(namespaceManager);
            }
        }
        /// <summary>
        /// Use HTTP transportation for this <see cref="IServiceBus"/> using the a predefined HTTP client.
        /// </summary>
        /// <param name="hostAddressConfiguration">The <see cref="IHostAddressConfiguration"/>.</param>
        /// <param name="client">The HTTP client to use.</param>
        /// <param name="messageSerialiser">The <see cref="IMessageSerialiser"/> to use.</param>
        /// <returns>The <see cref="ITransportConfiguration"/>.</returns>
        public static ITransportConfiguration WithHttpTransport(this IHostAddressConfiguration hostAddressConfiguration, HttpClient client, IMessageSerialiser messageSerialiser)
        {
            Argument.CannotBeNull(client, "client", "The HTTP transporter cannot accept a null HTTP Client.");
            Argument.CannotBeNull(messageSerialiser, "messageSerialiser", "A message serialiser to be used by the transporter cannot be null.");

            var transporter = new HttpTransporter(client, messageSerialiser);

            return(new TransportConfiguration(hostAddressConfiguration, transporter));
        }
Ejemplo n.º 25
0
        /// <summary>
        /// Gets the saga metadata from previous operations
        /// </summary>
        /// <param name="accessibleSaga">The accessible saga.</param>
        /// <param name="messageSerialiser">The message serialiser.</param>
        /// <returns></returns>
        public static SagaMetadata GetSagaMetadata(this IAccessibleSaga accessibleSaga, IMessageSerialiser messageSerialiser)
        {
            String serialisedMetadata;

            if (!accessibleSaga.Headers.TryGetValue(MetadataPipelineHook.MetadataKeyName, out serialisedMetadata))
            {
                return(null);
            }

            var metadata = messageSerialiser.Deserialise <SagaMetadata>(serialisedMetadata);

            return(metadata);
        }
		/// <summary>
		/// Create a new event hook, with the given storage queue.
		/// <para>You should use the static <see cref="Inject"/> method to
		/// add this hook.</para>
		/// </summary>
		public LocalQueueExceptionHook(IMessageSerialiser serialiser, string errorQueuePath)
		{
			_serialiser = serialiser;
			_errorQueueStorage = Path.Combine(errorQueuePath, LocalQueueConfig.IncomingQueueSubpath);
		}
Ejemplo n.º 27
0
 protected AzureEventHub(IConfigurationManager configurationManager, IMessageSerialiser <TAuthenticationToken> messageSerialiser, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, bool isAPublisher)
     : base(configurationManager, messageSerialiser, authenticationTokenHelper, correlationIdHelper, logger, isAPublisher)
 {
     TelemetryHelper = new NullTelemetryHelper();
 }
Ejemplo n.º 28
0
 protected AzureServiceBus(IConfigurationManager configurationManager, IMessageSerialiser <TAuthenticationToken> messageSerialiser, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, bool isAPublisher)
     : base(configurationManager, messageSerialiser, authenticationTokenHelper, correlationIdHelper, logger, isAPublisher)
 {
     ServiceBusReceivers = new Dictionary <int, SubscriptionClient>();
 }
Ejemplo n.º 29
0
 /// <summary>
 /// Instantiates a new instance of <see cref="AzureCommandBusReceiver{TAuthenticationToken}"/>.
 /// </summary>
 public AzureCommandBusReceiver(IConfigurationManager configurationManager, IMessageSerialiser <TAuthenticationToken> messageSerialiser, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, IAzureBusHelper <TAuthenticationToken> azureBusHelper, IBusHelper busHelper)
     : base(configurationManager, messageSerialiser, authenticationTokenHelper, correlationIdHelper, logger, azureBusHelper, busHelper, false)
 {
     TelemetryHelper = configurationManager.CreateTelemetryHelper("Cqrs.Azure.CommandBus.Receiver.UseApplicationInsightTelemetryHelper", correlationIdHelper);
     FilterKey       = new Dictionary <string, string>();
 }
 /// <summary>
 /// Use HTTP transportation for this <see cref="IServiceBus"/> using the default HTTP client.
 /// </summary>
 /// <param name="hostAddressConfiguration">The <see cref="IHostAddressConfiguration"/>.</param>
 /// <param name="messageSerialiser">The <see cref="IMessageSerialiser"/> to use.</param>
 /// <returns>The <see cref="ITransportConfiguration"/>.</returns>
 public static ITransportConfiguration WithHttpTransport(this IHostAddressConfiguration hostAddressConfiguration, IMessageSerialiser messageSerialiser)
 {
     return(hostAddressConfiguration.WithHttpTransport(new HttpClient(), messageSerialiser));
 }
 public MessageListener(Func <IHandlerResolver> handlerResolver, Func <IHandlerInvoker> handlerInvoker, IMessageSerialiser serialiser)
 {
     this._handlerResolver = handlerResolver;
     this._handlerInvoker  = handlerInvoker;
     this._serialiser      = serialiser;
 }
Ejemplo n.º 32
0
 /// <summary>
 /// Instantiates a new instance of <see cref="AzureEventBusPublisher{TAuthenticationToken}"/>.
 /// </summary>
 public AzureEventBusPublisher(IConfigurationManager configurationManager, IMessageSerialiser <TAuthenticationToken> messageSerialiser, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, IAzureBusHelper <TAuthenticationToken> azureBusHelper, IBusHelper busHelper, IHashAlgorithmFactory hashAlgorithmFactory)
     : base(configurationManager, messageSerialiser, authenticationTokenHelper, correlationIdHelper, logger, azureBusHelper, busHelper, hashAlgorithmFactory, true)
 {
     TelemetryHelper = configurationManager.CreateTelemetryHelper("Cqrs.Azure.EventBus.Publisher.UseApplicationInsightTelemetryHelper", correlationIdHelper);
 }
Ejemplo n.º 33
0
 public AzureQueuedEventBusReceiver(IConfigurationManager configurationManager, IMessageSerialiser <TAuthenticationToken> messageSerialiser, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, IAzureBusHelper <TAuthenticationToken> azureBusHelper)
     : base(configurationManager, messageSerialiser, authenticationTokenHelper, correlationIdHelper, logger, azureBusHelper)
 {
     QueueTracker     = new ConcurrentDictionary <string, ConcurrentQueue <IEvent <TAuthenticationToken> > >();
     QueueTrackerLock = new ReaderWriterLockSlim();
 }
Ejemplo n.º 34
0
        /// <summary>
        /// Initiates an instance of <see cref="SqlSagaRepository"/> with a connection string name.
        /// Actual connection string is taken from your app.config or web.config
        /// </summary>
        /// <param name="connectionFactory">An insantance implementing <see cref="IConnectionFactory"/></param>
        /// <param name="sagaFactory">An instance implementing <see cref="ISagaFactory"/></param>
        /// <param name="messageSerialiser">An instance implementing <see cref="IMessageSerialiser"/></param>
        public SqlSagaRepository(IConnectionFactory connectionFactory, ISagaFactory sagaFactory, IMessageSerialiser messageSerialiser)
        {
            Guard.ArgumentIsNotNull(connectionFactory, nameof(connectionFactory));
            Guard.ArgumentIsNotNull(sagaFactory, nameof(sagaFactory));
            Guard.ArgumentIsNotNull(messageSerialiser, nameof(messageSerialiser));

            this.messageSerialiser = messageSerialiser;
            this.sagaFactory       = sagaFactory;
            this.connectionFactory = connectionFactory;
        }
Ejemplo n.º 35
0
 protected AzureEventBus(IConfigurationManager configurationManager, IMessageSerialiser <TAuthenticationToken> messageSerialiser, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, IAzureBusHelper <TAuthenticationToken> azureBusHelper, IBusHelper busHelper, bool isAPublisher)
     : base(configurationManager, messageSerialiser, authenticationTokenHelper, correlationIdHelper, logger, azureBusHelper, busHelper, isAPublisher)
 {
 }
Ejemplo n.º 36
0
 public AzureCommandBusPublisher(IConfigurationManager configurationManager, IMessageSerialiser <TAuthenticationToken> messageSerialiser, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, IDependencyResolver dependencyResolver)
     : base(configurationManager, messageSerialiser, authenticationTokenHelper, correlationIdHelper, logger, true)
 {
     DependencyResolver = dependencyResolver;
 }
Ejemplo n.º 37
0
 /// <summary>
 /// Instantiates a new instance of <see cref="AzureBusHelper{TAuthenticationToken}"/>.
 /// </summary>
 public AzureBusHelper(IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, IMessageSerialiser <TAuthenticationToken> messageSerialiser, IBusHelper busHelper, IConfigurationManager configurationManager, IDependencyResolver dependencyResolver)
 {
     AuthenticationTokenHelper = authenticationTokenHelper;
     CorrelationIdHelper       = correlationIdHelper;
     Logger               = logger;
     MessageSerialiser    = messageSerialiser;
     BusHelper            = busHelper;
     DependencyResolver   = dependencyResolver;
     ConfigurationManager = configurationManager;
 }
Ejemplo n.º 38
0
 public AzureEventBusReceiver(IConfigurationManager configurationManager, IMessageSerialiser <TAuthenticationToken> messageSerialiser, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, IAzureBusHelper <TAuthenticationToken> azureBusHelper)
     : base(configurationManager, messageSerialiser, authenticationTokenHelper, correlationIdHelper, logger, azureBusHelper, false)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="InMemorySagaRepository"/> class.
 /// </summary>
 /// <param name="messageSerialiser">The message serialiser.</param>
 /// <param name="sagaFactory">The saga factory.</param>
 public InMemorySagaRepository(IMessageSerialiser messageSerialiser, ISagaFactory sagaFactory)
 {
     this.messageSerialiser = messageSerialiser;
     this.sagaFactory       = sagaFactory;
 }
 /// <summary>
 /// Use HTTP transportation for this <see cref="IServiceBus"/> using the default HTTP client.
 /// </summary>
 /// <param name="hostAddressConfiguration">The <see cref="IHostAddressConfiguration"/>.</param>
 /// <param name="messageSerialiser">The <see cref="IMessageSerialiser"/> to use.</param>
 /// <returns>The <see cref="ITransportConfiguration"/>.</returns>
 public static ITransportConfiguration WithHttpTransport(this IHostAddressConfiguration hostAddressConfiguration, IMessageSerialiser messageSerialiser)
 {
     return hostAddressConfiguration.WithHttpTransport(new HttpClient(), messageSerialiser);
 }
Ejemplo n.º 41
0
        /// <summary>
        /// Initiates an instance of <see cref="SqlSagaRepository"/> with a connection string name.
        /// Actual connection string is taken from your app.config or web.config
        /// </summary>
        /// <param name="connectionFactory">An insantance implementing <see cref="IConnectionFactory"/></param>
        /// <param name="sagaFactory">An instance implementing <see cref="ISagaFactory"/></param>
        /// <param name="messageSerialiser">An instance implementing <see cref="IMessageSerialiser"/></param>
        public SqlSagaRepository(IConnectionFactory connectionFactory, ISagaFactory sagaFactory, IMessageSerialiser messageSerialiser)
        {
            Guard.ArgumentIsNotNull(connectionFactory, nameof(connectionFactory));
            Guard.ArgumentIsNotNull(sagaFactory, nameof(sagaFactory));
            Guard.ArgumentIsNotNull(messageSerialiser, nameof(messageSerialiser));

            this.messageSerialiser = messageSerialiser;
            this.sagaFactory       = sagaFactory;
            this.connectionFactory = connectionFactory;

            if (connectionFactory.ConnectionIsToMySql())
            {
                this.queryWrapper = new MySqlQueryWrapper();
            }
            else
            {
                this.queryWrapper = new SqlQueryWrapper();
            }
        }
Ejemplo n.º 42
0
 /// <summary>
 /// Instantiate a new instance of <see cref="AzureEventHubBus{TAuthenticationToken}"/>.
 /// </summary>
 protected AzureEventHubBus(IConfigurationManager configurationManager, IMessageSerialiser <TAuthenticationToken> messageSerialiser, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, IHashAlgorithmFactory hashAlgorithmFactory, IAzureBusHelper <TAuthenticationToken> azureBusHelper, bool isAPublisher)
     : base(configurationManager, messageSerialiser, authenticationTokenHelper, correlationIdHelper, logger, hashAlgorithmFactory, isAPublisher)
 {
     AzureBusHelper = azureBusHelper;
 }
 /// <summary>
 /// Instantiates a new instance of <see cref="AzureCommandBusPublisher{TAuthenticationToken}"/>.
 /// </summary>
 public AzureCommandBusPublisher(IConfigurationManager configurationManager, IMessageSerialiser <TAuthenticationToken> messageSerialiser, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, IAzureBusHelper <TAuthenticationToken> azureBusHelper, IBusHelper busHelper, ILoggerSettings loggerSettings)
     : base(configurationManager, messageSerialiser, authenticationTokenHelper, correlationIdHelper, logger, azureBusHelper, busHelper, true)
 {
     LoggerSettings  = loggerSettings;
     TelemetryHelper = configurationManager.CreateTelemetryHelper("Cqrs.Azure.CommandBus.Publisher.UseApplicationInsightTelemetryHelper", correlationIdHelper);
 }
 public TransportDispatcher(ITransportManager transport, IMessageSerialiser serialiser)
 {
     this._serialiser = serialiser;
     this._transport  = transport;
 }
Ejemplo n.º 45
0
 public AzureCommandBusPublisher(IConfigurationManager configurationManager, IMessageSerialiser <TAuthenticationToken> messageSerialiser, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, IAzureBusHelper <TAuthenticationToken> azureBusHelper)
     : base(configurationManager, messageSerialiser, authenticationTokenHelper, correlationIdHelper, logger, azureBusHelper, true)
 {
 }
Ejemplo n.º 46
0
        private static void SendLoginResponse(IMessage loginResponse, TcpClient tcpClient)
        {
            IMessageSerialiser messageSerialiser = SerialiserFactory.GetSerialiser(loginResponse.MessageIdentifier);

            messageSerialiser.Serialise(tcpClient.GetStream(), loginResponse);
        }