lpp.rabbitmq.original.Producer.java Source code

Java tutorial

Introduction

Here is the source code for lpp.rabbitmq.original.Producer.java

Source

/*
 * Copyright 1999-2016 feidee.com All right reserved. This software is the
 * confidential and proprietary information of feidee.com ("Confidential
 * Information"). You shall not disclose such Confidential Information and shall
 * use it only in accordance with the terms of the license agreement you entered
 * into with feidee.com.
 */
package lpp.rabbitmq.original;

import java.io.IOException;
import java.io.Serializable;
import java.util.concurrent.TimeoutException;

import org.apache.commons.lang.SerializationUtils;

/**
 * ???
 * @author lipanpan
 * @time 2016224
 */
public class Producer extends EndPoint {

    public Producer(String endpointName, RabbitMqConfig config) throws IOException, TimeoutException {
        super(endpointName, config);
    }

    public void sendMessage(Serializable object) throws IOException {
        channel.basicPublish("", endPointName, null, SerializationUtils.serialize(object));
    }

}