Beispiel #1
0
        public QueueFixture(DatabaseFixture database)
        {
            var builder = new SqlMessageQueueConfigurationBuilder();

            Database      = database;
            Configuration = builder.HasConnectionString(database.ConnectionString).CreateConfiguration();
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SqlMessageReceiver"/> class.
        /// </summary>
        /// <param name="subscriptionId">The <see cref="Guid">GUID</see> that identifies the associated stream.</param>
        /// <param name="connectionString">The connection string used by the message receiver.</param>
        public SqlMessageReceiver(Guid subscriptionId, string connectionString)
        {
            Arg.NotNullOrEmpty(connectionString, nameof(connectionString));

            var builder = new SqlMessageQueueConfigurationBuilder().HasConnectionString(connectionString);

            Configuration  = builder.CreateConfiguration();
            SubscriptionId = subscriptionId;
        }
Beispiel #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SqlMessageSender"/> class.
        /// </summary>
        /// <param name="connectionString">The connection string used by the message receiver.</param>
        public SqlMessageSender(string connectionString)
        {
            Arg.NotNullOrEmpty(connectionString, nameof(connectionString));

            var builder = new SqlMessageQueueConfigurationBuilder().HasConnectionString(connectionString);

            Configuration     = builder.CreateConfiguration();
            messageSerializer = Configuration.MessageSerializer;
        }
Beispiel #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SqlMessageReceiver"/> class.
        /// </summary>
        /// <param name="streamName">The logical name of the associated stream. The name should be unique.</param>
        /// <param name="connectionString">The connection string used by the message receiver.</param>
        public SqlMessageReceiver(string streamName, string connectionString)
        {
            Arg.NotNullOrEmpty(streamName, nameof(streamName));
            Arg.NotNullOrEmpty(connectionString, nameof(connectionString));

            var builder = new SqlMessageQueueConfigurationBuilder().HasConnectionString(connectionString);

            Configuration  = builder.CreateConfiguration();
            SubscriptionId = Uuid.FromString(streamName);
        }
Beispiel #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SqlMessageReceiver"/> class.
        /// </summary>
        /// <param name="connectionString">The connection string used by the message receiver.</param>
        public SqlMessageReceiver(string connectionString)
        {
            Arg.NotNullOrEmpty(connectionString, nameof(connectionString));

            var assembly = GetEntryAssembly() ?? GetCallingAssembly() ?? GetType().GetTypeInfo().Assembly;
            var builder  = new SqlMessageQueueConfigurationBuilder().HasConnectionString(connectionString);

            Configuration  = builder.CreateConfiguration();
            SubscriptionId = Uuid.FromString(assembly.GetName().Name);
        }