This article is a mirror article of machine translation, please click here to jump to the original article.

View: 506951|Reply: 175

[Source] c# M2Mqtt Connection to Apollo MQTT Server [with Source Code]

  [Copy link]
Posted on 1/4/2017 3:02:41 PM | | | |

Share an MQTT testing tool
http://www.itsvse.com/thread-3905-1-1.html
(Source: Architect)
.NET/C# ActiveMQ operation example [Source code]
http://www.itsvse.com/thread-3907-1-1.html
(Source: Architect)
Summary of information about ActiveMQ and RabbitMQ
http://www.itsvse.com/thread-4659-1-1.html
(Source: Architect_Programmer)


Attach the code from the online first:

Establish a client connection and subscribe

Release the message



It is correct to connect to the mosquito MQTT server in the online code, but some code needs to be changed to connect to the Apollo MQTT server.

Then, I referred to many articles before writing them myself.

Source code download:

Tourists, if you want to see the hidden content of this post, pleaseReply


Score

Number of participants1MB+1 Collapse reason
lxc1118 + 1 Very powerful!

See all ratings





Previous:WeChat official account development VS remote debugging
Next:SQL Server syncs databases across servers or synchronizes them regularly
 Landlord| Posted on 1/4/2017 3:04:40 PM |
Apache Apollo is a proxy server that is mainly used for message request forwarding, and the following is an introduction to some of its commonly used configuration files
1. users.properties:
It is used to configure who can use the server and the corresponding passwords.
Its storage method in the file is: username = password, such as:
lily=123456
It means that a new user is added, the username is lily, and the password is 123456
2. groups.properties:
User mapping of holding groups simplifies access control lists through groups instead of individual users.
You can set up multiple users for a defined group, and users can use "| Divide, such as:
admins=admin|lily
Indicates that there are two users in the admins group, admin and lily
3. black-list.txt:
It is used to store IP addresses that are not allowed to connect to servers, which is equivalent to something like a blacklist.
For example:
10.20.9.147
It means that the above IP cannot connect to the server.
4. login.config:
is a server authentication profile that provides authentication for security apollo version 1.6, only the corresponding username and correct password can be connected
server.
5. apollo.xml of the main configuration file of the server:
This profile is used to control open ports, queues, security, web hosting settings, and more.
       1. Authentication: You can use <authenticationdomain="internal" /> to configure whether to connect to authentication, if its attribute enable is set to false, it means that anyone can connect to the server without authentication, the default is true
       2. access_rule: It can be used to define various behaviors of users towards server resources in broker or virtual_host. For example:
<access_rule allow="users" action="connect create, destroy send receive consume"/> indicates that users in the group users can perform the following operations on server resources: connect, create, destroy, send, receive, consume. Detailed operating instructions can be found at:
http://activemq.apache.org/apollo/documentation/user-manual.html
       3. message stores: By default, apollo uses the LevelDB store, but it is recommended to use the BDB store (cross-platform) to only use one of them. The configuration for using LevelDB store is: <leveldb_store directory="${apollo.base}/data"/> is provided by default without any modifications. To use BDB store, you need to go to the jar package support http://download.Oracle.com/maven/com/sleepycat/je/5.0.34/je-5.0.34.jar under the website, place the jar package under the lib directory of the server, and then change the configuration file to: <bdb_store directory="${apollo.base}/data"/>That's it.
       4. Connector: Used to configure the link protocol supported by the server and the corresponding port. For example:
<connector id="tcp" bind="tcp://0.0.0.0:61613" connection_limit="2000" protocol="mqtt"/>It means that TCP links are supported, the port used is 61613, the link limit is 2000, and the protocol for automatic listening is MQTT protocol
Posted on 9/5/2018 10:58:40 AM |

@小渣渣  Excuse me, I would like to ask about the SSL/TLS link. Since using m2mqtt, writing a client on .net, using a .crt certificate, apollo is Java architecture, and the certificate used is keystore encapsulated. So I generated the root certificate and server certificate myself, and packaged the server certificate into a keystore to replace the original keystore in apollo. First, I used PAHO testing, and set both the key store and the trust base to the keystore I generated for SSL secure communication, and the link was successful. Then programming in C#, I want to implement one-way authentication, set SSL Secure to true, load the root certificate, set the client certificate to empty, and the link fails. Then it was found that one-way authentication seemed to require client_auth attributes to be set. However, after setting this property (even if it is set to the default attribute i.e. client_auth=none), it is not possible to use the keystore to link to Apollo using the paho test. Don't know what you know about it? Thank you, big brother
Posted on 9/5/2018 10:34:37 AM |
Excuse me, I saw that you posted about the M2mqtt library link Apollo proxy service, I would like to ask, use .crt certificate on the client, use keystore on Apollo for SSL secure communication, want to implement one-way authentication, it seems that you need to set client_auth attributes. However, after setting this property (even if it is set to the default attribute i.e. client-auth=none), it is not possible to link to Apollo using keystore on the paho test side. Don't know what you know about it? Thank you, big brother
Posted on 5/2/2017 9:37:33 AM |
Asdasef thought of corruption in judges

Score

Number of participants1MB-1 contribute-1 Collapse reason
The temperature in the northern city is 22 degrees -1 -1 Please do not pour water, it is the duty of every member to improve the reply information.

See all ratings

Posted on 5/3/2017 10:30:56 AM |
To learn, in MQTT you need to replace Apollo
 Landlord| Posted on 5/3/2017 10:31:59 AM |
zjpzjp posted on 2017-5-3 10:30
To learn, in MQTT you need to replace Apollo

Apollo is flawed
Posted on 5/24/2017 10:43:39 AM |
Looking for related resources, MARK
Posted on 5/29/2017 1:48:05 PM |
It's good, it's what I want
Posted on 6/7/2017 10:15:28 AM |
Learning, thanks for sharing
Posted on 6/21/2017 12:37:04 PM |
MQTT to learn。。。。。
Posted on 6/27/2017 7:50:07 PM |
I also encountered this problem, thank you for sharing
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com