Skip to content

Commit

Permalink
Merge branch 'release/1.2.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Muller committed May 24, 2017
2 parents f446db0 + ce021bb commit 0895fb5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
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.3",
"version": "1.2.4",
"description": "AMQP wrapper for the carotte microservice framework",
"main": "src/index.js",
"repository": "https://github.com/cubyn/node-carotte-amqp",
Expand Down
13 changes: 13 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ function Carotte(config) {
options = {};
}

if (qualifier.startsWith('topic/')) {
const resubQualifier = qualifier.split('/');
qualifier = `topic/${resubQualifier[resubQualifier.length - 1]}`;
}

options = Object.assign({ headers: {}, context: {} }, options, parseQualifier(qualifier));
options.headers['x-destination'] = qualifier;

Expand Down Expand Up @@ -421,6 +426,14 @@ function Carotte(config) {

const bindedWith = options.routingKey || q.queue;
return chan.bindQueue(q.queue, exchangeName, bindedWith)
.then(() => {
if (qualifier.startsWith('topic/')) {
const resubQualifier = qualifier.split('/');
return chan.bindQueue(q.queue, exchangeName,
`${resubQualifier[resubQualifier.length - 1]}`);
}
return chan;
})
.then(() => {
consumerDebug(`${q.queue} binded on ${exchangeName} with ${bindedWith}`);

Expand Down

0 comments on commit 0895fb5

Please sign in to comment.