RabbitMQ message queue interface of PHP background docking unmanned vending machine

New project: docking unmanned vending machine (unmanned refrigerator)

I thought it was an API interface, for example:

The result is to connect to the RabbitMQ interface, which is like this:

 

Suddenly at a loss.

Then I found some information:

Basic concepts of RabbitMQ

Detailed explanation of each method of RabbitMQ (PHP version)

RabbitMQ work (Work) mode (PHP version)

PHP string and byte byte array conversion class example

Brief introduction of high byte and low byte

Explain the meaning and function of & 0xff

Use Wireshark to check AMQP 0-9-1 traffic

...

I learned some basics and successfully communicated with the communication server.

However, there is still a problem with sending operation requests, and the format of sending binary data is unclear.

Then the other party's technology sent a simple PHP example, and used the following examples for reference:

But there are still some places where I don’t know how to operate, and I have no previous experience in operating binary/bytes like this.

Later, the other party sent a data screenshot:

Suddenly on a whim, I remembered that wireshark captures packets and can see this hexadecimal format.

Then capture and filter:

Contrast:

Looking at the data packet sent, I finally got the idea of ​​adjusting the binary data packet.

Finally, the operation request is successfully sent, and the message sent by the communication server is received:

 

Log output the received message to the text, open it and take a look:

A string of garbled characters can be viewed using an editor with binary function:

 

 

 

 

 

 

 

Guess you like

Origin blog.csdn.net/yyws2039725/article/details/113732383