Function Summary
|
|
---|---|
|
|
|
|
|
|
|
|
|
|
Client language support
Transport protocol support
Deployment Support
This update
-
Add broadcast message (add broadcast mode to the producer) -
Add the operation of console "forced emptying" message -
Add "fokmq: ws" adaptation websocket sub protocol verification (avoid random connection) -
Add the cluster node panel of the "server broker" console to view the "memory usage" -
Optimize memory control of asynchronous message production side -
Optimize client lock processing. By default, no lock is changed to sequential lock -
Sokcet. d rises to 2.5.1
For simple programming
1) Start Service
docker run - p eighteen thousand six hundred and two : eighteen thousand six hundred and two -p eight thousand six hundred and two : eight thousand six hundred and two noearorg/folkmq-server: one point five . one
2) Programming
-
Introduce a small dependency
< dependency >
< groupId > org.noear </ groupId >
< artifactId > folkmq-transport-netty </ artifactId >
< version > 1.5.1 </ version >
</ dependency >
-
Write a program
public class ClientDemo { public static void main (String[] args) throws Exception { //Create a client and connect
MqClient client = FolkMQ.createClient( " folkmq://127.0.0.1:18602 " ) .nameAs( "demoapp" ) .connect(); //Subscribe to topics client.subscribe( "demo.topic" , message -> { System.out.println(message); }); //Publish general message client.publish( "demo.topic" , new MqMessage ( "helloworld!" )); //Publish Qos0 message client.publish( "demo.topic" , new MqMessage ( "helloworld!" ).qos( zero )); //Publish sequential messages client.publish( "demo.topic" , new MqMessage ( "helloworld!" ).sequence( true )); //Publish broadcast message client.publish( "demo.topic" , new MqMessage ( "helloworld!" ).broadcast( true )); //Publish timing message (or delay message) client.publish( "demo.topic" , new MqMessage ( "helloworld!" ).scheduled(Datetime.Now().addDay( ten ))); //...... etc. } }