GithubHelp home page GithubHelp logo

amqp.node-rpc-factory's People

Contributors

rudijs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

amqp.node-rpc-factory's Issues

publisher in the server example cannot create multiple reply queues

When publish two requests, two exclusive reply queues should be asserted so that multiple consumers can be supported. However, currently a new reply queue can only be created after the previous reply queue has been deleted. This introduces a bottleneck for web apps.

Publisher: IllegalOperationError: Connection closed

Hello,

When I send messages to the consumers, I have this error triggered once every two request.

Stack trace:

Publisher: Publishing: 
Publisher: IllegalOperationError: Connection closed
    at Connection.<anonymous> (/home/koren/dev/dialonce/amqp-tests/node_modules/amqp-rpc-factory/node_modules/amqplib/lib/connection.js:354:11)
    at Channel.C.sendImmediately (/home/koren/dev/dialonce/amqp-tests/node_modules/amqp-rpc-factory/node_modules/amqplib/lib/channel.js:63:26)
    at Channel.C.sendOrEnqueue (/home/koren/dev/dialonce/amqp-tests/node_modules/amqp-rpc-factory/node_modules/amqplib/lib/channel.js:74:10)
    at Channel.C._rpc (/home/koren/dev/dialonce/amqp-tests/node_modules/amqp-rpc-factory/node_modules/amqplib/lib/channel.js:130:8)
    at Channel.C.rpc (/home/koren/dev/dialonce/amqp-tests/node_modules/amqp-rpc-factory/node_modules/amqplib/lib/channel_model.js:59:8)
    at /home/koren/dev/dialonce/amqp-tests/node_modules/amqp-rpc-factory/node_modules/amqplib/lib/channel_model.js:70:17
    at tryCatchReject (/home/koren/dev/dialonce/amqp-tests/node_modules/amqp-rpc-factory/node_modules/amqplib/node_modules/when/lib/makePromise.js:840:30)
    at runContinuation1 (/home/koren/dev/dialonce/amqp-tests/node_modules/amqp-rpc-factory/node_modules/amqplib/node_modules/when/lib/makePromise.js:799:4)
    at Fulfilled.when (/home/koren/dev/dialonce/amqp-tests/node_modules/amqp-rpc-factory/node_modules/amqplib/node_modules/when/lib/makePromise.js:590:4)

Do you know where it could come from ?

Non Standalone Multiple Publisher Persistance

@robraux Hi Rob,

I've noticed a problem with allowing multiple instances of publishers to exist.

I'm using KoaJS (next gen of ExpressJS) and if the consumer is down when the publisher (the webserver) tries to send a message it will create a new persistent connection for every attempt.

For example, the consumer is down, and the web server sends 10 messages, it will create 10 (persistant) connections.

What it needs to do in my case is have 10 failures on the same single connection.

I'm going to dig into this more.

What you've pointed out here in you pull request:

The problem was with Object.create, the resulting object sets a property of a property. 
When two instances are created, they shared the same properties (e.g. queue, url, etc.).

This is actually the behavior I need when the publisher is a web server.

Can you elaborate more why you need the publisher to have multiple instances?

Thanks.

Empty Idle Queues

Hi,

first of all: thank you for your work.

every time I create an RPC producer call (not standalone), after receiving the rpc it leaves an empy idle queue on rabbitmq. It's not so funny because for example after 400 requests it leaves 400 empty idle queues.

I suggest that you set "autoDelete: true" when creating the queue.

Thank you

Idea: before after hooks

In my application I added a hooks factory around consumer and publisher create, but I in the publisher hooks I cannot get the correlation id.

Knowing the correlation id for me it would be escpeially useful for debugging and logging features. In this way I would be able to connect the parts in third party systems.

The concept can be used by JSON messages as well, check my example below:

What do you think about the following concept?

function myHook (msg, props) {
  console.log(props.correlationId)
}
var publisherOptions = {
...
beforeHooks: [myHook1, fromJS]
afterHooks: [toJS, myHook2]
}
var consumerOptions = {
...
beforeHooks: [toJS, myHook3]
afterHooks: [myHook4, fromJS]
}

I wanted to send a pr but stucked with the broken tests.

Any chance that you can take a look for the tests with 4.x.x Node.js?
Updating the packages would be also very helpful.

Thanks,
Peter

two publisher on same instance kill the node process if the rabbitmq server shutsdown

Hi,
I'm running two publisher with different queues names

I20160725-23:57:05.887(2)? Publisher: Unexpected amqplib connection error handled by domain:Error: read ECONNRESET
I20160725-23:57:05.887(2)?     at errnoException (net.js:905:11)
I20160725-23:57:05.888(2)?     at TCP.onread (net.js:559:19)
I20160725-23:57:05.888(2)? Publisher: Unexpected amqplib connection error handled by domain:Error: read ECONNRESET
I20160725-23:57:05.889(2)?     at errnoException (net.js:905:11)
I20160725-23:57:05.889(2)?     at TCP.onread (net.js:559:19)
W20160725-23:57:05.890(2)? (STDERR) 
W20160725-23:57:05.890(2)? (STDERR) TypeError: Cannot set property 'domain' of null
W20160725-23:57:05.890(2)? (STDERR)     at Domain.remove (domain.js:116:13)
W20160725-23:57:05.890(2)? (STDERR)     at Object.<anonymous> (/Users/bruchmann/git/pt/app/node_modules/amqp-rpc-factory/lib/rpc-publisher-factory.js:48:28)
W20160725-23:57:05.890(2)? (STDERR)     at Domain.emit (events.js:117:20)
W20160725-23:57:05.890(2)? (STDERR)     at ChannelModel.emit (events.js:70:21)
W20160725-23:57:05.891(2)? (STDERR)     at Connection.emit (events.js:95:17)
W20160725-23:57:05.891(2)? (STDERR)     at Connection.C.onSocketError (/Users/bruchmann/git/pt/app/node_modules/amqplib/lib/connection.js:351:10)
W20160725-23:57:05.891(2)? (STDERR)     at Socket.emit (events.js:117:20)
W20160725-23:57:05.891(2)? (STDERR)     at net.js:441:14
W20160725-23:57:05.891(2)? (STDERR)     at process._tickDomainCallback (node.js:502:13)

from how I understand code this may happen as the publisherDomain is "static" and both publisher receive the error callback as they are in the same domain.
now one of the two publisher may not have published anything so far and therefore the this.currentConnection is still null, which results in an error.

I guess on thing to fix it would be to do this in the error handling:

this.currentConnection && this.publisherDomain.remove(this.currentConnection);

But actually I think the domain should not be shared via initing it directly on the prototype but instead in the init method as you may have two instances with different rabbit server/urls and therefore the error events should not be shared.

Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.