content: package com.iot.container.producer;
  
  import com.iot.api.client.RsocketClientSession;
  import com.iot.common.annocation.ProtocolType;
  import com.iot.transport.client.TransportClient;
  import org.junit.Test;
  
  import java.util.concurrent.CountDownLatch;
  
  
  public class Producer_3 {
  
      @Test
      public void testClient() throws InterruptedException {
          CountDownLatch latch = new CountDownLatch(1);
      RsocketClientSession clientSession= TransportClient.create("192.168.100.237",1884)
                .heart(10000)
                .protocol(ProtocolType.MQTT)
                .ssl(false)
                .log(true)
                .clientId("Producer_3")
                  .password("12")
              .username("123")
              .willMessage("123")
              .willTopic("/lose")
                .exception(throwable -> System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&"+throwable))
                .messageAcceptor((topic,msg)->{
                      System.out.println(topic+":"+new String(msg));
                 })
                .connect()
                .block();
          for(int i=0;i<20;i++){
              clientSession.pub("/dict/asr_resualt/test1234","Producer_3".getBytes(),1).subscribe();
          }
          latch.await();
      }
  
  }
  