Skip to content

Commit

Permalink
Merge branch 'release/1.2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Muller committed May 24, 2017
2 parents b0faf2d + 90bcb0f commit f446db0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "carotte-amqp",
"version": "1.2.2",
"version": "1.2.3",
"description": "AMQP wrapper for the carotte microservice framework",
"main": "src/index.js",
"repository": "https://github.com/cubyn/node-carotte-amqp",
Expand Down
7 changes: 6 additions & 1 deletion src/describe.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
const replaceNonDirect = /^(topic|fanout)\//;

module.exports.subscribeToDescribe = function (carotte, qualifier, meta) {
qualifier = qualifier.replace(replaceNonDirect, 'direct/');
if (replaceNonDirect.test(qualifier)) {
qualifier = qualifier.replace(replaceNonDirect, 'direct/');
const parts = qualifier.split('/');
qualifier = `${parts[0]}/${parts[parts.length - 1]}`;
}

carotte.subscribe(`${qualifier}:describe`, { queue: { durable: false, autoDelete: true } }, () => {
return meta;
});
Expand Down
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ function Carotte(config) {
return ok.then(() => {
producerDebug(`publishing to ${options.routingKey} on ${exchangeName}`);
if (log) {
config.transport.info(`${rpc ? '>> ' : '> '} ${options.type}/${options.routingKey}`, {
config.transport.info(`${rpc ? ' ' : ' '} ${options.type}/${options.routingKey}`, {
context: options.context,
headers: options.headers,
data: payload,
Expand All @@ -261,7 +261,7 @@ function Carotte(config) {
});
})
.catch(err => {
config.transport.error(`${rpc ? '>> ' : '> '} ${options.type}/${options.routingKey}`, {
config.transport.error(`${rpc ? ' ' : ' '} ${options.type}/${options.routingKey}`, {
context: options.context,
headers: options.headers,
data: payload,
Expand Down Expand Up @@ -459,7 +459,7 @@ function Carotte(config) {
consumerDebug('Handler success');
// otherwise internal subscribe (rpc…)
if (qualifier) {
config.transport.info(`${rpc ? '<< ' : '< '} ${qualifier}`, {
config.transport.info(`${rpc ? ' ' : ' '} ${qualifier}`, {
context,
headers,
data,
Expand Down Expand Up @@ -499,7 +499,7 @@ function Carotte(config) {
const pubOptions = messageToOptions(qualifier, message);
const rpc = headers['x-reply-to'] !== undefined;

config.transport.error(`${rpc ? '<< ' : '< '} ${qualifier}`, {
config.transport.error(`${rpc ? ' ' : ' '} ${qualifier}`, {
context,
headers,
subscriber: qualifier,
Expand Down

0 comments on commit f446db0

Please sign in to comment.