@axinom/mosaic-message-bus 0.31.0-rc.1 → 0.31.0-rc.10

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.
Files changed (67) hide show
  1. package/dist/broker.d.ts +35 -5
  2. package/dist/broker.d.ts.map +1 -1
  3. package/dist/broker.js +31 -4
  4. package/dist/broker.js.map +1 -1
  5. package/dist/common/constants.d.ts +1 -0
  6. package/dist/common/constants.d.ts.map +1 -1
  7. package/dist/common/constants.js +2 -1
  8. package/dist/common/constants.js.map +1 -1
  9. package/dist/index.d.ts +1 -0
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +1 -0
  12. package/dist/index.js.map +1 -1
  13. package/dist/middleware/envelope-logging-middleware.d.ts +3 -2
  14. package/dist/middleware/envelope-logging-middleware.d.ts.map +1 -1
  15. package/dist/middleware/envelope-logging-middleware.js.map +1 -1
  16. package/dist/middleware/index.d.ts +0 -1
  17. package/dist/middleware/index.d.ts.map +1 -1
  18. package/dist/middleware/index.js +0 -1
  19. package/dist/middleware/index.js.map +1 -1
  20. package/dist/publication.d.ts +6 -4
  21. package/dist/publication.d.ts.map +1 -1
  22. package/dist/publication.js +21 -3
  23. package/dist/publication.js.map +1 -1
  24. package/dist/rascal-config-builder.d.ts.map +1 -1
  25. package/dist/rascal-config-builder.js.map +1 -1
  26. package/dist/{middleware/messaging-middleware.d.ts → setup-messaging-broker.d.ts} +7 -7
  27. package/dist/setup-messaging-broker.d.ts.map +1 -0
  28. package/dist/{middleware/messaging-middleware.js → setup-messaging-broker.js} +26 -8
  29. package/dist/setup-messaging-broker.js.map +1 -0
  30. package/dist/subscription.d.ts +3 -2
  31. package/dist/subscription.d.ts.map +1 -1
  32. package/dist/subscription.js +2 -2
  33. package/dist/subscription.js.map +1 -1
  34. package/dist/types/external-interfaces.d.ts +5 -62
  35. package/dist/types/external-interfaces.d.ts.map +1 -1
  36. package/dist/types/external-interfaces.js +0 -1
  37. package/dist/types/external-interfaces.js.map +1 -1
  38. package/dist/types/index.d.ts +1 -0
  39. package/dist/types/index.d.ts.map +1 -1
  40. package/dist/types/index.js +1 -0
  41. package/dist/types/index.js.map +1 -1
  42. package/dist/types/message-info.d.ts +2 -0
  43. package/dist/types/message-info.d.ts.map +1 -1
  44. package/dist/types/signing-details.d.ts +3 -0
  45. package/dist/types/signing-details.d.ts.map +1 -0
  46. package/dist/types/signing-details.js +3 -0
  47. package/dist/types/signing-details.js.map +1 -0
  48. package/package.json +4 -3
  49. package/src/broker.ts +61 -7
  50. package/src/common/constants.ts +1 -0
  51. package/src/index.ts +1 -0
  52. package/src/middleware/envelope-logging-middleware.ts +3 -7
  53. package/src/middleware/index.ts +0 -1
  54. package/src/publication.spec.ts +8 -9
  55. package/src/publication.ts +47 -11
  56. package/src/rascal-config-builder.spec.ts +6 -0
  57. package/src/rascal-config-builder.ts +2 -3
  58. package/src/{middleware/messaging-middleware.spec.ts → setup-messaging-broker.spec.ts} +1 -1
  59. package/src/{middleware/messaging-middleware.ts → setup-messaging-broker.ts} +41 -11
  60. package/src/subscription.spec.ts +4 -3
  61. package/src/subscription.ts +5 -9
  62. package/src/types/external-interfaces.ts +38 -79
  63. package/src/types/index.ts +1 -0
  64. package/src/types/message-info.ts +1 -0
  65. package/src/types/signing-details.ts +8 -0
  66. package/dist/middleware/messaging-middleware.d.ts.map +0 -1
  67. package/dist/middleware/messaging-middleware.js.map +0 -1
@@ -2,17 +2,18 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
2
2
  import { dirname } from 'path';
3
3
  import { BrokerConfig } from 'rascal';
4
4
  /* eslint-disable no-console */
5
- import { BrokerProxy } from '../broker';
6
- import { RascalConfigBuilder } from '../rascal-config-builder';
5
+ import {
6
+ Logger,
7
+ ShutdownActionsMiddleware,
8
+ } from '@axinom/mosaic-service-common';
9
+ import { BrokerProxy } from './broker';
10
+ import { MosaicFinalRedeliveryError } from './common';
11
+ import { RascalConfigBuilder } from './rascal-config-builder';
7
12
  import {
8
13
  MessagingConfig,
9
- MessagingLogger,
10
14
  MessagingRegistry,
11
- MessagingShutdownActions,
12
15
  OnMessageMiddleware,
13
- } from '../types';
14
-
15
- export const MosaicFinalRedeliveryError = 'mosaic_final_error';
16
+ } from './types';
16
17
 
17
18
  const buildRascalConfig = (
18
19
  config: MessagingConfig,
@@ -242,6 +243,16 @@ export const getMessagingBroker = (app: MessagingRegistry): BrokerProxy => {
242
243
  return app.get(messagingBrokerKey);
243
244
  };
244
245
 
246
+ /**
247
+ * Store the messaging broker instance inside of an express app context.
248
+ */
249
+ const setMessagingBroker = (
250
+ app: MessagingRegistry,
251
+ broker: BrokerProxy,
252
+ ): void => {
253
+ app.set(messagingBrokerKey, broker);
254
+ };
255
+
245
256
  /**
246
257
  * Settings object to set up messaging
247
258
  *
@@ -273,11 +284,11 @@ export interface MessagingBrokerSettings {
273
284
  /**
274
285
  * A Mosaic logger instance that debug logs on messaging broker shutdown and error/debug log during message processing.
275
286
  */
276
- logger: MessagingLogger;
287
+ logger: Logger;
277
288
  /**
278
289
  * ShutdownActionsMiddleware that will handle messaging broker shutdown when app is shut down.
279
290
  */
280
- shutdownActions: MessagingShutdownActions;
291
+ shutdownActions: ShutdownActionsMiddleware;
281
292
  /**
282
293
  * An array of middleware, each of which will be called when a message is received by subscription/message handler.
283
294
  */
@@ -331,7 +342,26 @@ export const setupMessagingBroker = async ({
331
342
  writeSourceFile(rascalConfigExportPath, cfg);
332
343
  }
333
344
 
334
- const broker = await BrokerProxy.create(cfg, logger, components);
345
+ const { rmqEventSigningPrivateKey, rmqEventSigningKeyVersion } = config;
346
+ if (
347
+ config.serviceId.startsWith('ax-') &&
348
+ (!rmqEventSigningPrivateKey ||
349
+ // Assuming version 0 as a valid option
350
+ rmqEventSigningKeyVersion === null ||
351
+ rmqEventSigningKeyVersion === undefined)
352
+ ) {
353
+ throw new Error(
354
+ 'Managed services must provide the RabbitMQ event signing private key and version.',
355
+ );
356
+ }
357
+ const signing =
358
+ rmqEventSigningPrivateKey &&
359
+ rmqEventSigningKeyVersion !== null &&
360
+ rmqEventSigningKeyVersion !== undefined
361
+ ? { rmqEventSigningPrivateKey, rmqEventSigningKeyVersion }
362
+ : undefined;
363
+
364
+ const broker = await BrokerProxy.create(cfg, logger, components, signing);
335
365
 
336
366
  for (const builder of builders) {
337
367
  if (!builder.buildMessageHandler) {
@@ -348,7 +378,7 @@ export const setupMessagingBroker = async ({
348
378
  await broker.shutdown();
349
379
  });
350
380
  if (app) {
351
- app.set(messagingBrokerKey, broker);
381
+ setMessagingBroker(app, broker);
352
382
  }
353
383
 
354
384
  return broker;
@@ -1,12 +1,13 @@
1
1
  /* eslint-disable no-console */
2
+ import { LogMessage, Logger } from '@axinom/mosaic-service-common';
2
3
  import { Message } from 'amqplib';
3
4
  import { stub } from 'jest-auto-stub';
4
5
  import 'jest-extended';
5
6
  import { BrokerAsPromised } from 'rascal';
7
+ import { MosaicFinalRedeliveryError } from './common';
6
8
  import { MessageHandler } from './message-handler';
7
- import { MosaicFinalRedeliveryError } from './middleware';
8
9
  import Subscription from './subscription';
9
- import { LogMessage, MessageEnvelope, MessagingLogger } from './types';
10
+ import { MessageEnvelope } from './types';
10
11
 
11
12
  class CustomError extends Error {
12
13
  protected code = 'CUSTOM_ERROR_CODE';
@@ -55,7 +56,7 @@ describe('Subscription', () => {
55
56
  },
56
57
  },
57
58
  });
58
- const logger = stub<MessagingLogger>({
59
+ const logger = stub<Logger>({
59
60
  error: (error: Error, message: LogMessage) => {
60
61
  loggedErrorMessage = message;
61
62
  loggedError = error as Error & {
@@ -1,3 +1,4 @@
1
+ import { Logger } from '@axinom/mosaic-service-common';
1
2
  import { Message } from 'amqplib';
2
3
  import { once } from 'ramda';
3
4
  import {
@@ -6,15 +7,9 @@ import {
6
7
  Recovery,
7
8
  SubscriberSessionAsPromised,
8
9
  } from 'rascal';
9
- import { getLogEnvelope } from './common';
10
+ import { MosaicFinalRedeliveryError, getLogEnvelope } from './common';
10
11
  import { MessageHandler } from './message-handler';
11
- import { MosaicFinalRedeliveryError } from './middleware';
12
- import {
13
- MessageEnvelope,
14
- MessageInfo,
15
- MessagingLogger,
16
- OnMessageMiddleware,
17
- } from './types';
12
+ import { MessageEnvelope, MessageInfo, OnMessageMiddleware } from './types';
18
13
 
19
14
  /**
20
15
  * Handles subscriptions to RabbitMQ queues and processing of messages using provided message handler and middleware functions.
@@ -27,7 +22,7 @@ export default class Subscription<TContent> {
27
22
  public readonly handler: MessageHandler<TContent>,
28
23
  private readonly broker: BrokerAsPromised,
29
24
  middleware: OnMessageMiddleware<TContent>[] = [],
30
- private readonly logger: MessagingLogger,
25
+ private readonly logger: Logger,
31
26
  ) {
32
27
  if (middleware !== undefined && middleware.length > 0) {
33
28
  this.middleware.push(...middleware);
@@ -61,6 +56,7 @@ export default class Subscription<TContent> {
61
56
  ): Promise<void> {
62
57
  const aon: AckOrNack = once(ackOrNack);
63
58
  const messageInfo: MessageInfo<TContent> = {
59
+ unparsedEnvelope: message.content,
64
60
  envelope,
65
61
  fields: message.fields,
66
62
  properties: message.properties,
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
-
3
- import { PublicationConfig as RascalPublicationConfig } from 'rascal';
2
+ import { BasicConfig, BasicRMQConfig } from '@axinom/mosaic-service-common';
3
+ import { PublicationConfig } from 'rascal';
4
4
 
5
5
  /**
6
6
  * An interface that represents a registry object which is used to register a messaging broker on app startup. Example using an express app:
@@ -23,83 +23,42 @@ export interface MessagingRegistry {
23
23
  * const config = getFullConfig();
24
24
  * ```
25
25
  */
26
- export interface MessagingConfig {
27
- isDev: boolean;
28
- serviceId: string;
29
- rmqProtocol: string;
30
- rmqVHost: string;
31
- rmqHost: string;
32
- rmqPort: number;
33
- rmqUser: string;
34
- rmqPassword: string;
35
- rmqVHostAssert: boolean;
36
- // Management properties are optional and by default resolved using base RabbitMQ connection properties. This is only used for VHost assertion (creation).
37
- rmqMgmtProtocol?: string;
38
- rmqMgmtHost?: string;
39
- rmqMgmtPort?: number;
40
- rmqChannelMax?: number;
41
-
42
- /**
43
- * Specifies client-properties to be passed along through the AMQP Connection.
44
- * The `connection_name` is a well-known property which will be useful for debugging purposes, and will be displayed
45
- * in the Broker's management UI (under `connections` tab)
46
- */
47
- clientProperties?: {
48
- /** If unspecified, the `serviceId` will be used as the connection_name, and will be visible in the Broker's management UI */
49
- connection_name?: string | undefined;
50
-
51
- /** Any custom key-value pair which will be displayed in the Connection Details of the Broker's management UI */
52
- [key: string]: string | undefined;
53
- };
54
- }
26
+ export type MessagingConfig = Pick<BasicConfig, 'isDev' | 'serviceId'> &
27
+ Pick<
28
+ BasicRMQConfig,
29
+ | 'rmqProtocol'
30
+ | 'rmqVHost'
31
+ | 'rmqHost'
32
+ | 'rmqPort'
33
+ | 'rmqUser'
34
+ | 'rmqPassword'
35
+ | 'rmqVHostAssert'
36
+ > &
37
+ Partial<
38
+ Pick<
39
+ BasicRMQConfig,
40
+ // Management properties are optional and by default resolved using base RabbitMQ connection properties. This is only used for VHost assertion (creation).
41
+ | 'rmqMgmtProtocol'
42
+ | 'rmqMgmtHost'
43
+ | 'rmqMgmtPort'
44
+ | 'rmqChannelMax'
45
+ // Signing is optional and should not be required by the broker
46
+ | 'rmqEventSigningPrivateKey'
47
+ | 'rmqEventSigningKeyVersion'
48
+ >
49
+ > & {
50
+ /**
51
+ * Specifies client-properties to be passed along through the AMQP Connection.
52
+ * The `connection_name` is a well-known property which will be useful for debugging purposes, and will be displayed
53
+ * in the Broker's management UI (under `connections` tab)
54
+ */
55
+ clientProperties?: {
56
+ /** If unspecified, the `serviceId` will be used as the connection_name, and will be visible in the Broker's management UI */
57
+ connection_name?: string | undefined;
55
58
 
56
- /**
57
- * An interface that represents a message object to be logged by MessagingLogger. An example of Mosaic implementation:
58
- * ```ts
59
- * import { Logger } from '@axinom/mosaic-service-common';
60
- * //...
61
- * const logger = new Logger();
62
- * logger.error({ message: "A messaging error has occurred.", context: 'messaging' })
63
- * ```
64
- */
65
- export interface LogMessage {
66
- message?: string;
67
- logtime?: string | Date;
68
- context?: string;
69
- details?: {
70
- [key: string]: unknown;
59
+ /** Any custom key-value pair which will be displayed in the Connection Details of the Broker's management UI */
60
+ [key: string]: string | undefined;
61
+ };
71
62
  };
72
- }
73
-
74
- /**
75
- * An interface that represents a logger implementation to be used by a messaging broker and shutdown actions. An example of Mosaic implementation:
76
- * ```ts
77
- * import { Logger } from '@axinom/mosaic-service-common';
78
- * //...
79
- * const logger = new Logger({ context: 'messaging' });
80
- * ```
81
- */
82
- export interface MessagingLogger {
83
- error(message: string | LogMessage): void;
84
- error(error: Error): void;
85
- error(error: Error, message: string | LogMessage): void;
86
-
87
- debug(message: string | LogMessage): void;
88
- debug(error: Error): void;
89
- debug(error: Error, message: string | LogMessage): void;
90
- }
91
-
92
- /**
93
- * An interface that represents a middleware object to be used to register messaging actions that are executed on app shutdown, e.g. broker shutdown.
94
- * An example of Mosaic implementation:
95
- * ```ts
96
- * import { setupShutdownActions, Logger } from '@axinom/mosaic-service-common';
97
- * //...
98
- * const shutdownActions = setupShutdownActions(app, logger);
99
- * ```
100
- */
101
- export interface MessagingShutdownActions {
102
- push(action: () => void | Promise<void>): void;
103
- }
104
63
 
105
- export type PublicationConfig = RascalPublicationConfig;
64
+ export type MessagePublicationConfig = PublicationConfig;
@@ -3,3 +3,4 @@ export * from './message-envelope';
3
3
  export * from './message-envelope-overrides';
4
4
  export * from './message-info';
5
5
  export * from './on-message-middleware';
6
+ export * from './signing-details';
@@ -6,6 +6,7 @@ import { MessageEnvelope } from './message-envelope';
6
6
  * Supplied to message handler methods as a parameter.
7
7
  */
8
8
  export interface MessageInfo<TContent = unknown> {
9
+ unparsedEnvelope: Buffer;
9
10
  envelope: MessageEnvelope<TContent>;
10
11
  fields: MessageFields;
11
12
  properties: MessageProperties;
@@ -0,0 +1,8 @@
1
+ import { BasicRMQConfig } from '@axinom/mosaic-service-common';
2
+
3
+ export type SigningDetails = Required<
4
+ Pick<
5
+ BasicRMQConfig,
6
+ 'rmqEventSigningPrivateKey' | 'rmqEventSigningKeyVersion'
7
+ >
8
+ >;
@@ -1 +0,0 @@
1
- {"version":3,"file":"messaging-middleware.d.ts","sourceRoot":"","sources":["../../src/middleware/messaging-middleware.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EACL,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,wBAAwB,EACxB,mBAAmB,EACpB,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,0BAA0B,uBAAuB,CAAC;AAuM/D,eAAO,MAAM,kBAAkB;iCArBK,YAAY,KAAG,MAAM;CAqBH,CAAC;AAwBvD;;GAEG;AACH,eAAO,MAAM,kBAAkB,QAAS,iBAAiB,KAAG,WAE3D,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,GAAG,CAAC,EAAE,iBAAiB,CAAC;IACxB;;OAEG;IACH,MAAM,EAAE,eAAe,CAAC;IACxB;;OAEG;IACH,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC;;OAEG;IACH,MAAM,EAAE,eAAe,CAAC;IACxB;;OAEG;IACH,eAAe,EAAE,wBAAwB,CAAC;IAC1C;;OAEG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAC5C;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC;;;;;OAKG;IACH,yBAAyB,CAAC,EAAE,CAC1B,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,MAAM,KACd,YAAY,CAAC;CACnB;AAED;;GAEG;AACH,eAAO,M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