• 大小: 0.39M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2020-12-27
  • 语言: Java
  • 标签: RabbitMQ  

资源简介

rabbitmq 实例源码下载

资源截图

代码片段和文件信息

/**
 * TODO
 * 
 */
package cn.itcast.publish;

/**
 * @author hushuang
 *
 */

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;

public class EmitLog {

    private static final String EXCHANGE_NAME = “logs“;

    public static void main(String[] argv) throws Exception {

        ConnectionFactory factory = new ConnectionFactory();
        factory.setHost(“localhost“);
        Connection connection = factory.newConnection();
        Channel channel = connection.createChannel();

        channel.exchangeDeclare(EXCHANGE_NAME “fanout“);

// 分发消息
for(int i = 0 ; i < 5; i++){
String message = “Hello World! “ + i;
 channel.basicPublish(EXCHANGE_NAME ““ null message.getBytes());
     System.out.println(“ [x] 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        363  2016-11-08 12:38  rabbitmq\.classpath

     文件        384  2016-11-08 11:31  rabbitmq\.project

     文件        598  2016-11-08 11:31  rabbitmq\.settings\org.eclipse.jdt.core.prefs

     文件       2170  2016-11-10 20:11  rabbitmq\bin\cn\itcast\publish\EmitLog.class

     文件       1500  2016-11-10 20:11  rabbitmq\bin\cn\itcast\publish\ReceiveLogs1$1.class

     文件       2284  2016-11-10 20:11  rabbitmq\bin\cn\itcast\publish\ReceiveLogs1.class

     文件       1500  2016-11-10 20:11  rabbitmq\bin\cn\itcast\publish\ReceiveLogs2$1.class

     文件       2284  2016-11-10 20:11  rabbitmq\bin\cn\itcast\publish\ReceiveLogs2.class

     文件       1612  2016-11-10 22:45  rabbitmq\bin\cn\itcast\topic\ReceiveLogsTopic1$1.class

     文件       2750  2016-11-10 22:45  rabbitmq\bin\cn\itcast\topic\ReceiveLogsTopic1.class

     文件       1612  2016-11-10 22:45  rabbitmq\bin\cn\itcast\topic\ReceiveLogsTopic2$1.class

     文件       2767  2016-11-10 22:45  rabbitmq\bin\cn\itcast\topic\ReceiveLogsTopic2.class

     文件       2774  2016-11-10 22:45  rabbitmq\bin\cn\itcast\topic\TopicSend.class

     文件       1608  2016-11-10 20:41  rabbitmq\bin\com\itcast\routing\ReceiveLogsDirect1$1.class

     文件       2859  2016-11-10 20:41  rabbitmq\bin\com\itcast\routing\ReceiveLogsDirect1.class

     文件       1608  2016-11-10 20:41  rabbitmq\bin\com\itcast\routing\ReceiveLogsDirect2$1.class

     文件       2826  2016-11-10 20:41  rabbitmq\bin\com\itcast\routing\ReceiveLogsDirect2.class

     文件       2366  2016-11-10 20:45  rabbitmq\bin\com\itcast\routing\RoutingSendDirect.class

     文件       1498  2016-11-08 16:07  rabbitmq\bin\com\rabbit\helloword\C$1.class

     文件       1759  2016-11-08 16:07  rabbitmq\bin\com\rabbit\helloword\C.class

     文件       2015  2016-11-08 16:13  rabbitmq\bin\com\rabbit\helloword\P.class

     文件       2296  2016-11-08 17:30  rabbitmq\bin\com\rabbit\queues\NewTask.class

     文件       1928  2016-11-08 19:35  rabbitmq\bin\com\rabbit\queues\Worker1$1.class

     文件       2214  2016-11-08 19:35  rabbitmq\bin\com\rabbit\queues\Worker1.class

     文件       1934  2016-11-08 19:54  rabbitmq\bin\com\rabbit\queues\Worker2$1.class

     文件       2330  2016-11-08 19:54  rabbitmq\bin\com\rabbit\queues\Worker2.class

     文件       2220  2016-11-08 20:48  rabbitmq\bin\com\rabbitmq\publish\EmitLog.class

     文件       1533  2016-11-08 21:13  rabbitmq\bin\com\rabbitmq\publish\ReceiveLogs1$1.class

     文件       2338  2016-11-08 21:13  rabbitmq\bin\com\rabbitmq\publish\ReceiveLogs1.class

     文件        303  2016-11-08 20:32  rabbitmq\bin\com\rabbitmq\publish\ReceiveLogs2.class

............此处省略50个文件信息

评论

共有 条评论