Java?????????
?????tjc123 ???????[ 2016/7/15 11:10:55 ] ??????????????????? Java
???????????£??????????????????????????????????е??
Channel channel = new Channel();
channel.queueDeclare(QUEUE_NAME?? true?? false?? false?? null);
int prefetchCount = 1;
channel.basicQos(prefetchCount);
byte[] bytes = message.getBytes("UTF-8");
channel.basicPublish(""??bytes);
?????????????Channel?????????????????????????????????????С?????Щ????£?????????
??????????????????????????????
public class Channel {
private int basicQos=0;
private AMQP.Queue queue;
public Channel()
{}
public Channel basicQos(int preCnt)
{
this.basicQos=preCnt;
return this;
}
public Channel queueDeclare(String queue?? boolean durable?? boolean exclusive?? boolean autoDelete??
Map<String?? Object> arguments)
{
this.queue=createQueue();
return this;
}
private AMQP.Queue createQueue()
{
return new AMQP.Queue();
}
public void basicPublish(String exchange??byte[] bytes)
{
//doSomething
}
}
???????????????????????????????磺
????@Test
????public void testChannel()
????{
????new Channel().basicQos(1).queueDeclare(""??true??false??false??null).basicPublish(""??new byte[]{1??3??4});
????}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11