@midwayjs/rabbitmq 3.0.0-beta.3 → 3.0.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,44 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.0.0-beta.7](https://github.com/midwayjs/midway/compare/v3.0.0-beta.6...v3.0.0-beta.7) (2021-12-03)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * middleware with ctx.body ([#1389](https://github.com/midwayjs/midway/issues/1389)) ([77af5c0](https://github.com/midwayjs/midway/commit/77af5c0b456f1843f4dcfd3dbfd2c0aa244c51bd))
12
+
13
+
14
+
15
+
16
+
17
+ # [3.0.0-beta.6](https://github.com/midwayjs/midway/compare/v3.0.0-beta.5...v3.0.0-beta.6) (2021-11-26)
18
+
19
+ **Note:** Version bump only for package @midwayjs/rabbitmq
20
+
21
+
22
+
23
+
24
+
25
+ # [3.0.0-beta.5](https://github.com/midwayjs/midway/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2021-11-25)
26
+
27
+ **Note:** Version bump only for package @midwayjs/rabbitmq
28
+
29
+
30
+
31
+
32
+
33
+ # [3.0.0-beta.4](https://github.com/midwayjs/midway/compare/v3.0.0-beta.3...v3.0.0-beta.4) (2021-11-24)
34
+
35
+
36
+ ### Features
37
+
38
+ * add i18n ([#1375](https://github.com/midwayjs/midway/issues/1375)) ([bffefe0](https://github.com/midwayjs/midway/commit/bffefe07afe45777d49b5a76b9ab17fc2b9d9a55))
39
+
40
+
41
+
42
+
43
+
6
44
  # [3.0.0-beta.3](https://github.com/midwayjs/midway/compare/v3.0.0-beta.2...v3.0.0-beta.3) (2021-11-18)
7
45
 
8
46
 
@@ -2,6 +2,5 @@ import { MidwayRabbitMQFramework } from './framework';
2
2
  export declare class RabbitMQConfiguration {
3
3
  framework: MidwayRabbitMQFramework;
4
4
  onReady(): Promise<void>;
5
- onServerReady(): Promise<void>;
6
5
  }
7
6
  //# sourceMappingURL=configuration.d.ts.map
@@ -14,11 +14,6 @@ const decorator_1 = require("@midwayjs/decorator");
14
14
  const framework_1 = require("./framework");
15
15
  let RabbitMQConfiguration = class RabbitMQConfiguration {
16
16
  async onReady() { }
17
- async onServerReady() {
18
- if (this.framework.isEnable()) {
19
- await this.framework.run();
20
- }
21
- }
22
17
  };
23
18
  __decorate([
24
19
  (0, decorator_1.Inject)(),
package/dist/framework.js CHANGED
@@ -61,12 +61,14 @@ let MidwayRabbitMQFramework = class MidwayRabbitMQFramework extends core_1.BaseF
61
61
  const fn = await this.getMiddleware(async (ctx) => {
62
62
  return await ins[listenerOptions.propertyKey].call(ins, data);
63
63
  });
64
- const { result, error } = await fn(ctx);
65
- if (error) {
66
- this.logger.error(error);
64
+ try {
65
+ const result = await fn(ctx);
66
+ if (result) {
67
+ return channelWrapper.ack(data);
68
+ }
67
69
  }
68
- if (result) {
69
- return channelWrapper.ack(data);
70
+ catch (error) {
71
+ this.logger.error(error);
70
72
  }
71
73
  });
72
74
  }
@@ -1,4 +1,4 @@
1
- import { IConfigurationOptions, IMidwayApplication, IMidwayContext } from '@midwayjs/core';
1
+ import { IConfigurationOptions, IMidwayApplication, IMidwayContext, NextFunction as BaseNextFunction } from '@midwayjs/core';
2
2
  import { ConsumeMessage, Options } from 'amqplib/properties';
3
3
  import { RabbitMQListenerOptions } from '@midwayjs/decorator';
4
4
  import type { ConfirmChannel, Channel, Options as AmqpOptions } from 'amqplib';
@@ -29,6 +29,7 @@ export declare type IMidwayRabbitMQContext = IMidwayContext<{
29
29
  export declare type Application = IMidwayRabbitMQApplication;
30
30
  export interface Context extends IMidwayRabbitMQContext {
31
31
  }
32
+ export declare type NextFunction = BaseNextFunction;
32
33
  export declare type DefaultConfig = string | AmqpOptions.Connect;
33
34
  declare module '@midwayjs/core/dist/interface' {
34
35
  interface MidwayConfig {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/rabbitmq",
3
- "version": "3.0.0-beta.3",
3
+ "version": "3.0.0-beta.7",
4
4
  "description": "Midway Framework for rabbitmq",
5
5
  "main": "dist/index",
6
6
  "typings": "dist/index.d.ts",
@@ -23,14 +23,14 @@
23
23
  ],
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@midwayjs/decorator": "^3.0.0-beta.3",
27
- "@midwayjs/mock": "^3.0.0-beta.3",
26
+ "@midwayjs/decorator": "^3.0.0-beta.7",
27
+ "@midwayjs/mock": "^3.0.0-beta.7",
28
28
  "@types/amqplib": "*",
29
29
  "fs-extra": "^8.0.1"
30
30
  },
31
31
  "dependencies": {
32
- "@midwayjs/core": "^3.0.0-beta.3",
33
- "@midwayjs/logger": "^3.0.0-beta.3",
32
+ "@midwayjs/core": "^3.0.0-beta.7",
33
+ "@midwayjs/logger": "^3.0.0-beta.7",
34
34
  "amqp-connection-manager": "^3.2.2",
35
35
  "amqplib": "*"
36
36
  },
@@ -46,5 +46,5 @@
46
46
  "engines": {
47
47
  "node": ">=12"
48
48
  },
49
- "gitHead": "a46b7f83d1cb161ec312f2892a9b33ff2d290d7e"
49
+ "gitHead": "24590729121d9110e2d960db5b5e587cf55a1efc"
50
50
  }