@nestjs/microservices
Advanced tools
Comparing version 10.3.1 to 10.3.2
@@ -102,3 +102,3 @@ "use strict"; | ||
const serializedPacket = this.serializer.serialize(packet); | ||
const inbox = natsPackage.createInbox(); | ||
const inbox = natsPackage.createInbox(this.options.inboxPrefix); | ||
const subscriptionHandler = this.createSubscriptionHandler(packet, callback); | ||
@@ -105,0 +105,0 @@ const subscription = this.natsClient.subscribe(inbox, { |
@@ -14,3 +14,3 @@ "use strict"; | ||
const client_proxy_1 = require("./client-proxy"); | ||
let rqmPackage = {}; | ||
let rmqPackage = {}; | ||
const REPLY_QUEUE = 'amq.rabbitmq.reply-to'; | ||
@@ -40,3 +40,3 @@ /** | ||
(0, load_package_util_1.loadPackage)('amqplib', ClientRMQ.name, () => require('amqplib')); | ||
rqmPackage = (0, load_package_util_1.loadPackage)('amqp-connection-manager', ClientRMQ.name, () => require('amqp-connection-manager')); | ||
rmqPackage = (0, load_package_util_1.loadPackage)('amqp-connection-manager', ClientRMQ.name, () => require('amqp-connection-manager')); | ||
this.initializeSerializer(options); | ||
@@ -78,3 +78,3 @@ this.initializeDeserializer(options); | ||
const socketOptions = this.getOptionsProp(this.options, 'socketOptions'); | ||
return rqmPackage.connect(this.urls, { | ||
return rmqPackage.connect(this.urls, { | ||
connectionOptions: socketOptions, | ||
@@ -81,0 +81,0 @@ }); |
@@ -36,2 +36,3 @@ export declare const TCP_DEFAULT_PORT = 3000; | ||
export declare const RQM_NO_EVENT_HANDLER: (text: TemplateStringsArray, pattern: string) => string; | ||
export declare const RQM_NO_MESSAGE_HANDLER: (text: TemplateStringsArray, pattern: string) => string; | ||
export declare const GRPC_DEFAULT_PROTO_LOADER = "@grpc/proto-loader"; | ||
@@ -38,0 +39,0 @@ export declare const NO_EVENT_HANDLER: (text: TemplateStringsArray, pattern: string) => string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CONNECTION_FAILED_MESSAGE = exports.EADDRINUSE = exports.CONN_ERR = exports.ECONNREFUSED = exports.MQTT_WILDCARD_ALL = exports.MQTT_WILDCARD_SINGLE = exports.MQTT_SEPARATOR = exports.KAFKA_DEFAULT_GROUP = exports.KAFKA_DEFAULT_CLIENT = exports.DISCONNECTED_RMQ_MESSAGE = exports.NO_MESSAGE_HANDLER = exports.NO_EVENT_HANDLER = exports.GRPC_DEFAULT_PROTO_LOADER = exports.RQM_NO_EVENT_HANDLER = exports.RQM_DEFAULT_NO_ASSERT = exports.RQM_DEFAULT_PERSISTENT = exports.RQM_DEFAULT_NOACK = exports.RQM_DEFAULT_QUEUE_OPTIONS = exports.RQM_DEFAULT_IS_GLOBAL_PREFETCH_COUNT = exports.RQM_DEFAULT_PREFETCH_COUNT = exports.RQM_DEFAULT_QUEUE = exports.REPLY_PATTERN_METADATA = exports.REQUEST_PATTERN_METADATA = exports.PARAM_ARGS_METADATA = exports.CLIENT_METADATA = exports.PATTERN_HANDLER_METADATA = exports.CLIENT_CONFIGURATION_METADATA = exports.TRANSPORT_METADATA = exports.PATTERN_EXTRAS_METADATA = exports.PATTERN_METADATA = exports.CANCEL_EVENT = exports.SUBSCRIBE = exports.CLOSE_EVENT = exports.ERROR_EVENT = exports.DATA_EVENT = exports.MESSAGE_EVENT = exports.CONNECT_FAILED_EVENT = exports.DISCONNECT_EVENT = exports.CONNECT_EVENT = exports.KAFKA_DEFAULT_BROKER = exports.RQM_DEFAULT_URL = exports.GRPC_DEFAULT_URL = exports.MQTT_DEFAULT_URL = exports.NATS_DEFAULT_URL = exports.REDIS_DEFAULT_HOST = exports.REDIS_DEFAULT_PORT = exports.TCP_DEFAULT_HOST = exports.TCP_DEFAULT_PORT = void 0; | ||
exports.CONNECTION_FAILED_MESSAGE = exports.EADDRINUSE = exports.CONN_ERR = exports.ECONNREFUSED = exports.MQTT_WILDCARD_ALL = exports.MQTT_WILDCARD_SINGLE = exports.MQTT_SEPARATOR = exports.KAFKA_DEFAULT_GROUP = exports.KAFKA_DEFAULT_CLIENT = exports.DISCONNECTED_RMQ_MESSAGE = exports.NO_MESSAGE_HANDLER = exports.NO_EVENT_HANDLER = exports.GRPC_DEFAULT_PROTO_LOADER = exports.RQM_NO_MESSAGE_HANDLER = exports.RQM_NO_EVENT_HANDLER = exports.RQM_DEFAULT_NO_ASSERT = exports.RQM_DEFAULT_PERSISTENT = exports.RQM_DEFAULT_NOACK = exports.RQM_DEFAULT_QUEUE_OPTIONS = exports.RQM_DEFAULT_IS_GLOBAL_PREFETCH_COUNT = exports.RQM_DEFAULT_PREFETCH_COUNT = exports.RQM_DEFAULT_QUEUE = exports.REPLY_PATTERN_METADATA = exports.REQUEST_PATTERN_METADATA = exports.PARAM_ARGS_METADATA = exports.CLIENT_METADATA = exports.PATTERN_HANDLER_METADATA = exports.CLIENT_CONFIGURATION_METADATA = exports.TRANSPORT_METADATA = exports.PATTERN_EXTRAS_METADATA = exports.PATTERN_METADATA = exports.CANCEL_EVENT = exports.SUBSCRIBE = exports.CLOSE_EVENT = exports.ERROR_EVENT = exports.DATA_EVENT = exports.MESSAGE_EVENT = exports.CONNECT_FAILED_EVENT = exports.DISCONNECT_EVENT = exports.CONNECT_EVENT = exports.KAFKA_DEFAULT_BROKER = exports.RQM_DEFAULT_URL = exports.GRPC_DEFAULT_URL = exports.MQTT_DEFAULT_URL = exports.NATS_DEFAULT_URL = exports.REDIS_DEFAULT_HOST = exports.REDIS_DEFAULT_PORT = exports.TCP_DEFAULT_HOST = exports.TCP_DEFAULT_PORT = void 0; | ||
const constants_1 = require("@nestjs/common/constants"); | ||
@@ -39,4 +39,6 @@ exports.TCP_DEFAULT_PORT = 3000; | ||
exports.RQM_DEFAULT_NO_ASSERT = false; | ||
const RQM_NO_EVENT_HANDLER = (text, pattern) => `An unsupported event was received. It has been acknowledged, so it will not be re-delivered. Pattern: ${pattern}`; | ||
const RQM_NO_EVENT_HANDLER = (text, pattern) => `An unsupported event was received. It has been negative acknowledged, so it will not be re-delivered. Pattern: ${pattern}`; | ||
exports.RQM_NO_EVENT_HANDLER = RQM_NO_EVENT_HANDLER; | ||
const RQM_NO_MESSAGE_HANDLER = (text, pattern) => `An unsupported message was received. It has been negative acknowledged, so it will not be re-delivered. Pattern: ${pattern}`; | ||
exports.RQM_NO_MESSAGE_HANDLER = RQM_NO_MESSAGE_HANDLER; | ||
exports.GRPC_DEFAULT_PROTO_LOADER = '@grpc/proto-loader'; | ||
@@ -43,0 +45,0 @@ const NO_EVENT_HANDLER = (text, pattern) => `There is no matching event handler defined in the remote service. Event pattern: ${pattern}`; |
@@ -36,2 +36,6 @@ /** | ||
}; | ||
export type SaslAuthenticateArgs<ParseResult> = { | ||
request: SaslAuthenticationRequest; | ||
response?: SaslAuthenticationResponse<ParseResult>; | ||
}; | ||
type AuthenticationProviderArgs = { | ||
@@ -41,3 +45,3 @@ host: string; | ||
logger: Logger; | ||
saslAuthenticate: <ParseResult>(request: SaslAuthenticationRequest, response?: SaslAuthenticationResponse<ParseResult>) => Promise<ParseResult | void>; | ||
saslAuthenticate: <ParseResult>(args: SaslAuthenticateArgs<ParseResult>) => Promise<ParseResult | void>; | ||
}; | ||
@@ -44,0 +48,0 @@ type Mechanism = { |
@@ -0,1 +1,6 @@ | ||
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import { ConnectionOptions } from 'tls'; | ||
import { TcpSocketConnectOpts } from 'net'; | ||
/** | ||
@@ -19,2 +24,18 @@ * @publicApi | ||
} | ||
type AmqpConnectionOptions = (ConnectionOptions | TcpSocketConnectOpts) & { | ||
noDelay?: boolean; | ||
timeout?: number; | ||
keepAlive?: boolean; | ||
keepAliveDelay?: number; | ||
clientProperties?: any; | ||
credentials?: { | ||
mechanism: string; | ||
username: string; | ||
password: string; | ||
response: () => Buffer; | ||
} | { | ||
mechanism: string; | ||
response: () => Buffer; | ||
} | undefined; | ||
}; | ||
/** | ||
@@ -27,3 +48,3 @@ * @publicApi | ||
findServers?: () => string | string[]; | ||
connectionOptions?: any; | ||
connectionOptions?: AmqpConnectionOptions; | ||
clientProperties?: ClientProperties; | ||
@@ -30,0 +51,0 @@ [key: string]: any; |
{ | ||
"name": "@nestjs/microservices", | ||
"version": "10.3.1", | ||
"version": "10.3.2", | ||
"description": "Nest - modern, fast, powerful node.js web framework (@microservices)", | ||
@@ -25,4 +25,4 @@ "author": "Kamil Mysliwiec", | ||
"devDependencies": { | ||
"@nestjs/common": "10.3.1", | ||
"@nestjs/core": "10.3.1" | ||
"@nestjs/common": "10.3.2", | ||
"@nestjs/core": "10.3.2" | ||
}, | ||
@@ -41,3 +41,3 @@ "peerDependencies": { | ||
"nats": "*", | ||
"reflect-metadata": "^0.1.12", | ||
"reflect-metadata": "^0.1.12 || ^0.2.0", | ||
"rxjs": "^7.1.0" | ||
@@ -44,0 +44,0 @@ }, |
@@ -10,3 +10,3 @@ "use strict"; | ||
const server_1 = require("./server"); | ||
let rqmPackage = {}; | ||
let rmqPackage = {}; | ||
const INFINITE_CONNECTION_ATTEMPTS = -1; | ||
@@ -37,3 +37,3 @@ class ServerRMQ extends server_1.Server { | ||
this.loadPackage('amqplib', ServerRMQ.name, () => require('amqplib')); | ||
rqmPackage = this.loadPackage('amqp-connection-manager', ServerRMQ.name, () => require('amqp-connection-manager')); | ||
rmqPackage = this.loadPackage('amqp-connection-manager', ServerRMQ.name, () => require('amqp-connection-manager')); | ||
this.initializeSerializer(options); | ||
@@ -88,3 +88,3 @@ this.initializeDeserializer(options); | ||
const socketOptions = this.getOptionsProp(this.options, 'socketOptions'); | ||
return rqmPackage.connect(this.urls, { | ||
return rmqPackage.connect(this.urls, { | ||
connectionOptions: socketOptions, | ||
@@ -122,2 +122,6 @@ heartbeatIntervalInSeconds: socketOptions?.heartbeatIntervalInSeconds, | ||
if (!handler) { | ||
if (!this.noAck) { | ||
this.logger.warn((0, constants_1.RQM_NO_MESSAGE_HANDLER) `${pattern}`); | ||
this.channel.nack(rmqContext.getMessage(), false, false); | ||
} | ||
const status = 'error'; | ||
@@ -124,0 +128,0 @@ const noHandlerPacket = { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
390853
9441