---- message - Synchronous \ asynchronous \-way \ complete the order process

Preparing a message

Turn off the firewall running

systemctl stop firewalld.service

This one does not perform, there will be no on-Fi 

MQClientException: No route info of this topic, xxxxx

Close namesrv Service:


sh bin/mqshutdown namesrv

Close broker services:


sh bin/mqshutdown broker

 

Start each server nameserver

nohup sh bin/mqnamesrv &    
tail -f nohup.out

 

Start broker

# Nohup sh bin / mqbroker -n localhost: 9876 autoCreateTopicEnable = true & single broker started

nohup sh bin / mqbroker -c /opt/rocketmq-all-4.3.0-bin-release/conf/2m-2s-sync/broker-a.properties & cluster broker startup
tail -f ~ / logs / rocketmqlogs / broker. log

 

Message By Category

Synchronization: the order of execution is important message for transmitting

Asynchronous: returned by the user to obtain information on the high speed requirements of the scene in the callback

One-way: you do not need to obtain information on whether the return is not concerned about the message sent successfully, such as included in the log

Sequence: when sending the same message to a condition of a queue when received, the received message to a queue with the same thread.

Synchronize

producer.setCreateTopicKey("AUTO_CREATE_TOPIC_KEY"); 

Without sentence, there will be:

org.apache.rocketmq.remoting.exception.RemotingTooMuchRequestException:sendDefaultImpl call timeout
broker connections are not

Delay send

Delayed reception

asynchronous

unidirectional

order

Producers

consumer

Delay

Complicated by

        List<Message> msgs = new ArrayList<Message>();
        Message msg1 = new Message("BaseTopic","Tag1",("Hello World"+1).getBytes());
                Message msg2 = new Message("BaseTopic","Tag1",("Hello World"+2).getBytes());
                Message msg3 = new Message("BaseTopic","Tag1",("Hello World"+3).getBytes());
                msgs.add(msg1);
                msgs.add(msg2);
                msgs.add(msg3);
          SendResult result = producer.send(msgs);

According to sql consumption _

Send Affairs

 

consumption

 
Published 73 original articles · won praise 1 · views 10000 +

Guess you like

Origin blog.csdn.net/wenxi2367/article/details/104448525