Skip to content

1.5.0/latest#13

Open
ileinone wants to merge 35 commits intomasterfrom
1.5.0/latest
Open

1.5.0/latest#13
ileinone wants to merge 35 commits intomasterfrom
1.5.0/latest

Conversation

@ileinone
Copy link

Please review changes including

  • Batch processing of the messages
  • Transaction management

@ileinone
Copy link
Author

Transmission of messages within:

  • Transaction scope

  • Batch scope

@ileinone ileinone closed this Aug 24, 2020
@ileinone ileinone reopened this Aug 24, 2020
Copy link

@EkiH EkiH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This library is not thread safe, the connection setup/disconnect should be protected with a lock. The Task also only supports a connection to one host at a time which should be documented. Although not too probable, someone might try to use it to connect to multiple separate RabbitMQs concurrently.

@ileinone ileinone changed the base branch from FCOM_224 to master August 27, 2020 08:19

return true;
// Commit under transaction when all of the messages have been received for the producer.
if (channel.MessageCount(inputParams.QueueName) == inputParams.WriteMessageCount)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using message counts for specifying when to commit a message seems a bit error prone. It would be better to have a separate Task for committing the batch.

CreateBasicPublishBatch(inputParams.ProcessExecutionId, channel).Publish();
channel.TxCommit();

if (channel.MessageCount(inputParams.QueueName) > 0)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why rollback here, isn't the transaction committed right above this and rolling back here would have no effect or throw an error?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if there are messages left in the bounded context all messages needs to be rollbacked.

<packages>
<package id="Microsoft.Diagnostics.Tracing.EventSource.Redist" version="1.1.28" targetFramework="net452" />
<package id="RabbitMQ.Client" version="5.1.0" targetFramework="net452" />
<package id="System.IO.Compression" version="4.3.0" targetFramework="net452" />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer needed as the compression was removed?

| RoutingKey | string | Routing key (as in RabbitMQ specification) | sampleQueue |
| HostName | string | Address of the server hosting RabbitMQ | localhost or amqp://user:password@hostname:port/vhost |
| WriteMessageCount | string | Amount of messages in the buffer which will be sent over messaging queue as a batch. | 20 |
| ProcessExecutionId | string | Unique id of the process execution. | igbmdajlskdhlfjaeirjwkdjfasdflht |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably instruct the user to use #process.executionid

| RoutingKey | string | Routing key (as in RabbitMQ specification) | sampleQueue |
| HostName | string | Address of the server hosting RabbitMQ | localhost or amqp://user:password@hostname:port/vhost |
| ConnectWithURI | bool | If true, hostname should be an URI | If false, use hostname only |
| ProcessExecutionId | string | Unique id of the process execution. | igbmdajlskdhlfjaeirjwkdjfasdflht |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably instruct the user to use #process.executionid

| ExchangeName | string | Name of the exchange | sampleExchange |
| RoutingKey | string | Routing key (as in RabbitMQ specification) | sampleQueue |
| HostName | string | Address of the server hosting RabbitMQ | localhost or amqp://user:password@hostname:port/vhost |
| WriteMessageCount | string | Amount of messages in the buffer which will be sent over messaging queue as a batch. | 20 |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are going to use the WriteMessageCount to signal when the batch should be committed, that should be reflected in the documentation. IMHO it would be more clear to have the separate task for committing the batch instead. This way the functionality isn't "magic" for the user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants