Skip to content

Commit dc8470e

Browse files
authored
Release prepare (#127)
* Preparing release -> libraries major versions * Fixing flaky test * upgrading md
1 parent d67b717 commit dc8470e

File tree

7 files changed

+63
-12
lines changed

7 files changed

+63
-12
lines changed

UPGRADING.md

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,60 @@
11
# Upgrading Guide
22

3-
We have introduced the following breaking changes on version `12.0.0`, please follow the steps below to update your code
4-
from the previous version to the new one.
3+
## Upgrading from `12.0.0` to `13.0.0`
54

6-
## Breaking Changes
5+
### Description of Breaking Change
6+
- The property `prehandlers` has been updated to `preHandler` for consumers.
7+
- In the SQS and SNS consumer, `consumerOverrides` no longer permits the alteration of critical properties such as
8+
`sqs`, `queueUrl`, `handler`, and `handleMessageBatch` to prevent confusion and maintain proper functionality of
9+
the consumer.
10+
- The `consumerOverrides` in the SQS and SNS consumer no longer includes the option to define the `visibilityTimeout`
11+
property, as it is now automatically determined by the consumer from the `creationConfig` or queue configuration in the
12+
case of `locatorConfig`.
13+
14+
### Migration Steps
15+
#### preHandlers
16+
If you currently utilize the `prehandlers` property in your consumer, it will be necessary to update it to `preHandler`.
17+
18+
#### ConsumerOverrides
19+
If you are implementing the `consumerOverrides` property in your consumer, it is essential to eliminate the properties
20+
`sqs`, `queueUrl`, `handler`, `handleMessageBatch`, and `visibilityTimeout`.
21+
- `sqs` should be included in the constructor dependencies
22+
- `queueUrl` is managed automatically by the library and does not require manual specification
23+
- `handleMessageBatch` is not supported by the library
24+
- `visibilityTimeout` is automatically managed by the library and does not need explicit declaration
25+
- For the `handler`, use the `handler` property in the constructor as demonstrated below
26+
```typescript
27+
export class MyConsumer extends AbstractAmqpConsumer<MyType, undefined> {
28+
public static QUEUE_NAME = 'my-queue-name'
29+
30+
constructor(dependencies: AMQPConsumerDependencies) {
31+
super(
32+
dependencies,
33+
{
34+
creationConfig: {
35+
queueName: AmqpPermissionConsumer.QUEUE_NAME,
36+
queueOptions: { durable: true, autoDelete: false },
37+
},
38+
messageTypeField: 'messageType',
39+
handlers: new MessageHandlerConfigBuilder<SupportedEvents, ExecutionContext>()
40+
.addConfig(
41+
MY_MESSAGE_SCHEMA,
42+
async (message) => {
43+
// Your handling code
44+
return {
45+
result: 'success',
46+
}
47+
},
48+
)
49+
.build(),
50+
},
51+
undefined
52+
)
53+
}
54+
}
55+
```
56+
57+
## Upgrading from `11.0.0 `to `12.0.0`
758

859
### Description of Breaking Change
960
Multi consumers and publishers can accomplish the same tasks as mono ones, but they add extra layer of complexity by

packages/amqp/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@message-queue-toolkit/amqp",
3-
"version": "12.0.3",
3+
"version": "13.0.0",
44
"private": false,
55
"license": "MIT",
66
"description": "AMQP adapter for message-queue-toolkit",
@@ -25,11 +25,11 @@
2525
"prepublishOnly": "npm run build:release"
2626
},
2727
"dependencies": {
28-
"@lokalise/node-core": "^9.10.1",
28+
"@lokalise/node-core": "^9.14.0",
2929
"zod": "^3.22.4"
3030
},
3131
"peerDependencies": {
32-
"@message-queue-toolkit/core": "^10.1.1",
32+
"@message-queue-toolkit/core": "^11.0.0",
3333
"amqplib": "^0.10.3"
3434
},
3535
"devDependencies": {

packages/core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@message-queue-toolkit/core",
3-
"version": "10.1.1",
3+
"version": "11.0.0",
44
"private": false,
55
"license": "MIT",
66
"description": "Useful utilities, interfaces and base classes for message queue handling. Supports AMQP and SQS with a common abstraction on top currently",
@@ -25,7 +25,7 @@
2525
"prepublishOnly": "npm run build:release"
2626
},
2727
"dependencies": {
28-
"@lokalise/node-core": "^9.10.1",
28+
"@lokalise/node-core": "^9.14.0",
2929
"fast-equals": "^5.0.1",
3030
"toad-cache": "^3.7.0"
3131
},

packages/sns/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"peerDependencies": {
3333
"@aws-sdk/client-sns": "^3.476.0",
3434
"@aws-sdk/client-sqs": "^3.476.0",
35-
"@message-queue-toolkit/core": "^10.1.1",
35+
"@message-queue-toolkit/core": "^11.0.0",
3636
"@message-queue-toolkit/sqs": "^13.0.0"
3737
},
3838
"devDependencies": {

packages/sns/test/consumers/SnsSqsPermissionConsumer.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ describe('SnsSqsPermissionConsumer', () => {
474474
consumerOverrides: { heartbeatInterval: heartbeatEnabled ? 1 : undefined },
475475
removeHandlerOverride: async () => {
476476
consumer1IsProcessing = true
477-
await setTimeout(2800) // Wait to the visibility timeout to expire
477+
await setTimeout(3100) // Wait to the visibility timeout to expire
478478
consumer1Counter++
479479
consumer1IsProcessing = false
480480
return { result: 'success' }

packages/sqs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
},
3232
"peerDependencies": {
3333
"@aws-sdk/client-sqs": "^3.476.0",
34-
"@message-queue-toolkit/core": "^10.1.1"
34+
"@message-queue-toolkit/core": "^11.0.0"
3535
},
3636
"devDependencies": {
3737
"@aws-sdk/client-sqs": "^3.529.1",

packages/sqs/test/consumers/SqsPermissionConsumer.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ describe('SqsPermissionConsumer', () => {
521521
consumerOverrides: { heartbeatInterval: heartbeatEnabled ? 1 : undefined },
522522
removeHandlerOverride: async () => {
523523
consumer1IsProcessing = true
524-
await setTimeout(2800) // Wait to the visibility timeout to expire
524+
await setTimeout(3100) // Wait to the visibility timeout to expire
525525
consumer1Counter++
526526
consumer1IsProcessing = false
527527
return { result: 'success' }

0 commit comments

Comments
 (0)