postwait / node-amqp

[UNMAINTAINED] node-amqp is an AMQP client for nodejs
MIT License
1.7k stars 357 forks source link

Documentation(README) doesn't mention the builtin low-level debugging support #431

Closed DannyvdSluijs closed 5 years ago

DannyvdSluijs commented 8 years ago

When adding below line to your code the output becomes very low level, and is very helpful for following the protocol layer.

process.env['NODE_DEBUG_AMQP'] = true;

Results in:

making non-ssl connection
setting connection timeout to 10000
Initiating handshake...
connected so resetting connection timeout
execute: 0100000000001c000a000a00090000000000000005504c41494e00000005656e5f5553ce
Executing method 0 { name: 'connectionStart',
  fields: 
   [ { name: 'versionMajor', domain: 'octet' },
     { name: 'versionMinor', domain: 'octet' },
     { name: 'serverProperties', domain: 'table' },
     { name: 'mechanisms', domain: 'longstr' },
     { name: 'locales', domain: 'longstr' } ],
  methodIndex: 10,
  classIndex: 10 } { versionMajor: 0,
  versionMinor: 9,
  serverProperties: {},
  mechanisms: 'PLAIN',
  locales: 'en_US' }
0 > connectionStart {"versionMajor":0,"versionMinor":9,"serverProperties":{},"mechanisms":"PLAIN","locales":"en_US"}
Passed bad server check
0 < connectionStartOk {"clientProperties":{"version":"0.2.4","platform":"node-v5.0.0","product":"node-amqp"},"mechanism":"PLAIN","response":"\u0000admin\u0000admin","locale":"en_US"}
sending frame: [object Object]
execute: 0100000000000c000a001e01000000ffff0000ce
Executing method 0 { name: 'connectionTune',
  fields: 
   [ { name: 'channelMax', domain: 'short' },
     { name: 'frameMax', domain: 'long' },
     { name: 'heartbeat', domain: 'short' } ],
  methodIndex: 30,
  classIndex: 10 } { channelMax: 256, frameMax: 65535, heartbeat: 0 }
0 > connectionTune {"channelMax":256,"frameMax":65535,"heartbeat":0}
tweaking maxFrameBuffer to 65535
tweaking channelMax to 256
0 < connectionTuneOk {"channelMax":256,"frameMax":65535,"heartbeat":0}
sending frame: [object Object]
0 < connectionOpen {"virtualHost":"carbon","reserved1":"","reserved2":true}
sending frame: [object Object]
execute: 0100000000000b000a002906636172626f6ece
Executing method 0 { name: 'connectionOpenOk',
  fields: [ { name: 'reserved1', domain: 'shortstr' } ],
  methodIndex: 41,
  classIndex: 10 } { reserved1: 'carbon' }
0 > connectionOpenOk {"reserved1":"carbon"}
1 < channelOpen {"reserved1":""}
sending frame: [object Object]
execute: 010001000000180014000b00000010b3a05f50b08d4c44baacd199f0e60836ce
Executing method 1 { name: 'channelOpenOk',
  fields: [ { name: 'reserved1', domain: 'longstr' } ],
  methodIndex: 11,
  classIndex: 20 } { reserved1: '��_P��LD��љ��\b6' }
1 > channelOpenOk {"reserved1":"��_P��LD��љ��\b6"}
1 < queueDeclare {"reserved1":0,"queue":"my-queue","passive":false,"durable":false,"exclusive":false,"autoDelete":true,"noWait":false,"arguments":{}}
sending frame: [object Object]
execute: 010001000000150032000b086d792d71756575650000000000000000ce
Executing method 1 { name: 'queueDeclareOk',
  fields: 
   [ { name: 'queue', domain: 'shortstr' },
     { name: 'messageCount', domain: 'long' },
     { name: 'consumerCount', domain: 'long' } ],
  methodIndex: 11,
  classIndex: 50 } { queue: 'my-queue', messageCount: 0, consumerCount: 0 }
1 > queueDeclareOk {"queue":"my-queue","messageCount":0,"consumerCount":0}
1 < basicConsume {"reserved1":0,"queue":"my-queue","consumerTag":"node-amqp-99155-0.7654451387934387","noLocal":false,"noAck":true,"exclusive":false,"noWait":false,"arguments":{}}
sending frame: [object Object]
execute: 01000100000027003c0015226e6f64652d616d71702d39393135352d302e37363534343531333837393334333837ce
Executing method 1 { name: 'basicConsumeOk',
  fields: [ { name: 'consumerTag', domain: 'shortstr' } ],
  methodIndex: 21,
  classIndex: 60 } { consumerTag: 'node-amqp-99155-0.7654451387934387' }
1 > basicConsumeOk {"consumerTag":"node-amqp-99155-0.7654451387934387"}
bwoodmansee commented 7 years ago

This helped me - thank you!