コード例 #1
0
 public void ReturnMessageToSourceQueue()
 {
     ErrorQueue.ReturnMessageToSourceQueue(
         errorQueueMachine: Environment.MachineName,
         errorQueueName: "error",
         userName: "******",
         password: "******",
         messageId: "6698f196-bd50-4f3c-8819-a49e0163d57b");
 }
コード例 #2
0
    public void ReturnMessageToSourceQueue()
    {
        var connectionFactory = new ConnectionFactory
        {
            HostName = "localhost",
            Port     = AmqpTcpEndpoint.UseDefaultPort,
            UserName = "******",
            Password = "******",
        };

        using (var connection = connectionFactory.CreateConnection())
        {
            ErrorQueue.ReturnMessageToSourceQueue(
                connection: connection,
                errorQueueName: "error",
                messageId: "26afdee3-ac53-4990-95ef-a61300ca15c8");
        }
    }
コード例 #3
0
    public void ReturnMessageToSourceQueue()
    {
        State state = new State();

        using (IBus bus = StartBus(state))
        {
            bus.SendLocal(new MessageToSend());
            Guid msmqMessageId = GetMsmqMessageId();

            state.ShouldHandlerThrow = false;

            ErrorQueue.ReturnMessageToSourceQueue(
                errorQueueConnectionString: connectionString,
                errorQueueName: errorQueueName,
                retryConnectionString: connectionString,
                retryQueueName: endpointName,
                messageId: msmqMessageId);

            state.ResetEvent.WaitOne();
        }
    }
コード例 #4
0
    public async Task ReturnMessageToSourceQueue()
    {
        var state = new State();

        using (var bus = StartBus(state))
        {
            bus.SendLocal(new MessageToSend());
            var msmqMessageId = await GetMsmqMessageId()
                                .ConfigureAwait(false);

            state.ShouldHandlerThrow = false;

            await ErrorQueue.ReturnMessageToSourceQueue(
                errorQueueConnectionString : connectionString,
                errorQueueName : errorQueueName,
                retryConnectionString : connectionString,
                retryQueueName : endpointName,
                messageId : msmqMessageId)
            .ConfigureAwait(false);

            state.ResetEvent.WaitOne();
        }
    }