Properties properties = new Properties();
// ProducerId,代表一类Producer,请向MetaQ运维人员申请
properties.put(PropertyKeyConst.ProducerId, "ProducerId1");
properties.put(PropertyKeyConst.ProducerId, "ProducerId1");
Producer producer = ONSFactory.createProducer(properties);
producer.start();
Message msg = new Message(//
"TopicTestONS", // Topic, 请向ONS运维人员申请
"TagA", // Tag, 相当于子Topic概念,应用可以自由设置,Consumer消费时,可以通过他来过滤消息
"Hello ONS".getBytes()// 消息内容,二进制形式
);