Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'call' of undefined #47

Closed
Dmitry-N-Medvedev opened this issue Dec 22, 2015 · 1 comment
Closed

Cannot read property 'call' of undefined #47

Dmitry-N-Medvedev opened this issue Dec 22, 2015 · 1 comment

Comments

@Dmitry-N-Medvedev
Copy link

Hi.

If the arguments is not empty (see JSON config below), the exchange.declare would return the "Cannot read property 'call' of undefined". If the arguments contains nothing then exchange.declare succeeds.

Please, advise.

{
  "name":         "x-ae",
  "description":  "Alternative Exchange",
  "type":         "direct",
  "passive":      false,
  "durable":      true,
  "auto_delete":  false,
  "internal":     false,
  "no_wait":      false,
  "arguments":    {
    "x-dead-letter-exchange":   "x-dl"
  }
}

This is the trace:

at FrameSerializer.serializeValue (backend/node_modules/bramqp/lib/frameSerializer.js:284:35)
      at FrameSerializer.serializeTable (backend/node_modules/bramqp/lib/frameSerializer.js:273:9)
      at FrameSerializer.serializeFields (backend/node_modules/bramqp/lib/frameSerializer.js:304:34)
      at FrameSerializer.serializeFrameMethod (backend/node_modules/bramqp/lib/frameSerializer.js:336:7)
      at ConnectionHandle.methodBuffer (backend/node_modules/bramqp/lib/connectionHandle.js:378:23)
      at ConnectionHandle.method (backend/node_modules/bramqp/lib/connectionHandle.js:347:25)
      at Object.declare (backend/node_modules/bramqp/lib/connectionHandle.js:121:12)
      at RMQInfra._mapper (rmqinfra.js:65:40)
      at Array.map (native)
      at RMQInfra._recreate_exchanges (rmqinfra.js:92:41)
      at RMQInfra.recreate (rmqinfra.js:111:14)
      at Object.on_initialized (rmqinfra_spec.js:32:27)
      at RMQConnector.<anonymous> (rmqconnector.js:32:41)
      at backend/node_modules/bramqp/node_modules/async/lib/async.js:697:13
      at backend/node_modules/bramqp/node_modules/async/lib/async.js:52:16
      at backend/node_modules/bramqp/node_modules/async/lib/async.js:272:32
      at backend/node_modules/bramqp/node_modules/async/lib/async.js:44:16
      at backend/node_modules/bramqp/node_modules/async/lib/async.js:694:17
      at backend/node_modules/bramqp/node_modules/async/lib/async.js:173:37
      at ConnectionHandle.<anonymous> (backend/node_modules/bramqp/lib/connectionHandle.js:315:6)
      at FrameParser.<anonymous> (backend/node_modules/bramqp/lib/connectionHandle.js:141:8)
      at FrameParser.parseFrameMethod (backend/node_modules/bramqp/lib/frameParser.js:273:7)
      at FrameParser.parseFrameEnd (backend/node_modules/bramqp/lib/frameParser.js:415:63)
      at FrameParser.parseFramePayload (backend/node_modules/bramqp/lib/frameParser.js:392:16)
      at FrameParser.parseFrameStart (backend/node_modules/bramqp/lib/frameParser.js:374:16)
      at FrameParser.parse (backend/node_modules/bramqp/lib/frameParser.js:433:57)
      at Socket.<anonymous> (backend/node_modules/bramqp/lib/connectionHandle.js:40:22)
      at readableAddChunk (_stream_readable.js:146:16)
      at Socket.Readable.push (_stream_readable.js:110:10)
      at TCP.onread (net.js:523:20)
@bakkerthehacker
Copy link
Owner

The data passed into arguments must have a type specified along with it to ensure that things like strings and integers get serialized into the correct AMQP type.

This is documented in the Value Types page.

In this case, The arguments should look like:

  "arguments":    {
    "x-dead-letter-exchange":   {
      type: "Long string",
      data: "x-dl"
    }
  }

It would be nice if the parser/serializer gave more meaningful error messages. This improvement is tracked in issue #13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants