|
@ -1,6 +1,9 @@
|
|
|
package com.yihu.hos.arbiter.services;
|
|
|
|
|
|
import org.junit.Test;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
import org.springframework.boot.test.context.TestComponent;
|
|
|
import org.zbus.broker.ZbusBroker;
|
|
|
import org.zbus.mq.Producer;
|
|
|
import org.zbus.net.http.Message;
|
|
@ -9,10 +12,13 @@ import org.zbus.net.http.Message;
|
|
|
* @author Airhead
|
|
|
* @since 2016/12/22.
|
|
|
*/
|
|
|
@SpringBootTest
|
|
|
public class ProxyServiceTest {
|
|
|
@Autowired
|
|
|
private ZbusBroker zbusBroker;
|
|
|
@Test
|
|
|
public void proxy() throws Exception {
|
|
|
Producer producer = new Producer(new ZbusBroker("192.168.131.38:15555"), "RemoteControl");
|
|
|
Producer producer = new Producer(zbusBroker, "RemoteControl");
|
|
|
producer.createMQ();//确定为创建消息队列需要显示调用
|
|
|
Message msg = new Message();
|
|
|
msg.setBody("hello world"); //消息体底层是byte[]
|