diff --git a/docs/MigrationGuide.md b/docs/MigrationGuide.md index 7b7956eb..ea57ca95 100644 --- a/docs/MigrationGuide.md +++ b/docs/MigrationGuide.md @@ -2,63 +2,69 @@ ## Migration from v2 to v3 -* Manually load the package `Ansible-Deprecated-V3` that has transformation of deprecated messages. +* Manually load the package `Ansible-Deprecated-V3` that has transformation of +deprecated messages. -* `RabbitMQWorker` has been refactored to be used by composition instead of inheritance: -The classes that subclassified it implemented the subclass responsibility `#configureConnection:` and `#process: payload` should be changed to instantiate `RabbitMQWorker` as to pass that process logic to the `processingPayloadWith:` collaborator. +* `RabbitMQWorker` has been refactored to be used by composition instead of +inheritance: The classes that subclassified it implemented the subclass +responsibility `#configureConnection:` and `#process: payload` should be +changed to instantiate `RabbitMQWorker` as to pass that process logic to the +`processingPayloadWith:` collaborator. -For instance, +For instance, -``` +```smalltalk Class { - #name : 'RabbitMQTextReverser', - #superclass : 'RabbitMQWorker', - #instVars : [ + #name : 'RabbitMQTextReverser', + #superclass : 'RabbitMQWorker', + #instVars : [ 'testCase', ] } { #category : 'initialization' } -RabbitMQTextReverser >> initializeWorkingWith: aTestCase +RabbitMQTextReverser >> initializeWorkingWith: aTestCase testCase := aTestCase { #category : 'private' } -RabbitMQTextReverser >> #configureConnection: builder - +RabbitMQTextReverser >> #configureConnection: builder + builder hostname: 'localhost'. - builder portNumber: 5672. - builder username: 'guest'. - builder password: 'guest'. + builder portNumber: 5672. + builder username: 'guest'. + builder password: 'guest'. { #category : 'private' } -RabbitMQTextReverser >> process: payload - +RabbitMQTextReverser >> process: payload + testCase storeText: payload utf8Decoded reversed ``` Should be refactored to -``` +```smalltalk Class { - #name : 'RabbitMQTextReverser', - #superclass : 'Object', - #instVars : [ + #name : 'RabbitMQTextReverser', + #superclass : 'Object', + #instVars : [ 'worker' ] } -RabbitMQTextReverser >> initializeWorkingWith: aTestCase +RabbitMQTextReverser >> initializeWorkingWith: aTestCase worker := RabbitMQWorker configuredBy: [ :options | - options + options at: #hostname 'localhost';. at: #port 5672;. - at: #username 'guest';. - at: #password 'guest' + at: #username 'guest';. + at: #password 'guest' ] - processingMessagesWith: [ :payload | aTestCase storeText: payload utf8Decoded reversed ]. + processingMessagesWith: [ :payload | + aTestCase storeText: payload utf8Decoded reversed + ]. worker start -``` \ No newline at end of file +``` diff --git a/docs/tutorials/RabbitMQPublisher.md b/docs/tutorials/RabbitMQPublisher.md index c318a0f7..31db660e 100644 --- a/docs/tutorials/RabbitMQPublisher.md +++ b/docs/tutorials/RabbitMQPublisher.md @@ -1,9 +1,11 @@ -# RabbitMQPublisher +# RabbitMQPublisher -This object will connect to an AMQP channel and knows how to publish messages to the specified queue for further processing. +This object will connect to an AMQP channel and knows how to publish messages +to the specified queue for further processing. -Accepts the following options: +Accepts the following options: + | Attribute name | Description | Optional/Mandatory | Default value | | ---------------|-------------|--------------------|---------------| | #hostname | Hostname of the rabbitmq broker | Optional | localhost | @@ -13,5 +15,5 @@ Accepts the following options: | #maximumConnectionAttemps | Amount of retries when connecting to the broker fails | Optional | 3 | | #timeSlotBetweenConnectionRetriesInMs | Time duration between retry attempts determined by using the exponential backoff algorithm | Optional | 3000 | | #enableDebuggingLogs | A boolean indicating whether to log debugging events | Optional | false | -| #extraClientProperties | A dictionary with keys and values to set the (client properties)[https://www.rabbitmq.com/docs/connections#capabilities] | Optional | Empty | +| #extraClientProperties | A dictionary with keys and values to set the [client properties](https://www.rabbitmq.com/docs/connections#capabilities) |Optional | Empty | | #retry | A block that can configure the internal `Retry` instance | Optional | `[]` | \ No newline at end of file diff --git a/docs/tutorials/RabbitMQWorker.md b/docs/tutorials/RabbitMQWorker.md index 788ff67c..424065dc 100644 --- a/docs/tutorials/RabbitMQWorker.md +++ b/docs/tutorials/RabbitMQWorker.md @@ -1,9 +1,11 @@ -# RabbitMQWorker +# RabbitMQWorker -This object will connect to an AMQP channel and knows how to consume messages from a specified queue for processing. +This object will connect to an AMQP channel and knows how to consume messages +from a specified queue for processing. -Accepts the following options: +Accepts the following options: + | Attribute name | Description | Optional/Mandatory | Default value | | ---------------|-------------|--------------------|---------------| | #hostname | Hostname of the rabbitmq broker | Optional | localhost | @@ -13,7 +15,7 @@ Accepts the following options: | #maximumConnectionAttemps | Amount of retries when connecting to the broker fails | Optional | 3 | | #timeSlotBetweenConnectionRetriesInMs | Time duration between retry attempts determined by using the exponential backoff algorithm | Optional | 3000 | | #enableDebuggingLogs | A boolean indicating whether to log debugging events | Optional | false | -| #extraClientProperties | A dictionary with keys and values to set the (client properties)[https://www.rabbitmq.com/docs/connections#capabilities] | Optional | Empty | +| #extraClientProperties | A dictionary with keys and values to set the [client properties](https://www.rabbitmq.com/docs/connections#capabilities)| Optional | Empty | | #retry | A block that can configure the internal `Retry` instance | Optional | `[]` | | #queueName | Queue name where to consume from | Mandatory | | | #queueDurable | When false sets the [queue durability](https://www.rabbitmq.com/docs/queues#durability) to transient, otherwise will be durable | Optional | true |