Java Code Examples for org.apache.rocketmq.test.client.rmq.RMQNormalProducer

The following examples show how to use org.apache.rocketmq.test.client.rmq.RMQNormalProducer. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: DDMQ   Source File: AbstractMQProducer.java    License: Apache License 2.0 5 votes vote down vote up
public Object getMessageByTag(String tag) {
    Object objMsg = null;
    if (this instanceof RMQNormalProducer) {
        org.apache.rocketmq.common.message.Message msg = new org.apache.rocketmq.common.message.Message(
            topic, (RandomUtil.getStringByUUID() + "." + new Date()).getBytes());
        objMsg = msg;
        if (tag != null) {
            msg.setTags(tag);
        }
    }
    return objMsg;
}
 
Example 2
Source Project: DDMQ   Source File: BaseConf.java    License: Apache License 2.0 5 votes vote down vote up
public static RMQNormalProducer getProducer(String nsAddr, String topic, boolean useTLS) {
    RMQNormalProducer producer = new RMQNormalProducer(nsAddr, topic, useTLS);
    if (debug) {
        producer.setDebug();
    }
    mqClients.add(producer);
    return producer;
}
 
Example 3
Source Project: DDMQ   Source File: BaseConf.java    License: Apache License 2.0 5 votes vote down vote up
public static RMQNormalProducer getProducer(String nsAddr, String topic, String producerGoup,
    String instanceName) {
    RMQNormalProducer producer = new RMQNormalProducer(nsAddr, topic, producerGoup,
        instanceName);
    if (debug) {
        producer.setDebug();
    }
    mqClients.add(producer);
    return producer;
}
 
Example 4
/**
 * @since version3.4.6
 */
@Test
public void testTwoProducerSameGroupAndInstanceName() {
    RMQNormalProducer producer1 = getProducer(nsAddr, topic);
    assertThat(producer1.isStartSuccess()).isEqualTo(true);
    RMQNormalProducer producer2 = getProducer(nsAddr, topic,
        producer1.getProducerGroupName(), producer1.getProducerInstanceName());
    assertThat(producer2.isStartSuccess()).isEqualTo(false);
}
 
Example 5
/**
 * @since version3.4.6
 */
@Test
public void testTwoProducerSameGroup() {
    RMQNormalProducer producer1 = getProducer(nsAddr, topic);
    assertThat(producer1.isStartSuccess()).isEqualTo(true);
    RMQNormalProducer producer2 = getProducer(nsAddr, topic,
        producer1.getProducerGroupName(), RandomUtils.getStringByUUID());
    assertThat(producer2.isStartSuccess()).isEqualTo(true);
}
 
Example 6
Source Project: rocketmq-4.3.0   Source File: AbstractMQProducer.java    License: Apache License 2.0 5 votes vote down vote up
public Object getMessageByTag(String tag) {
    Object objMsg = null;
    if (this instanceof RMQNormalProducer) {
        org.apache.rocketmq.common.message.Message msg = new org.apache.rocketmq.common.message.Message(
            topic, (RandomUtil.getStringByUUID() + "." + new Date()).getBytes());
        objMsg = msg;
        if (tag != null) {
            msg.setTags(tag);
        }
    }
    return objMsg;
}
 
Example 7
Source Project: rocketmq-4.3.0   Source File: BaseConf.java    License: Apache License 2.0 5 votes vote down vote up
public static RMQNormalProducer getProducer(String nsAddr, String topic, boolean useTLS) {
    RMQNormalProducer producer = new RMQNormalProducer(nsAddr, topic, useTLS);
    if (debug) {
        producer.setDebug();
    }
    mqClients.add(producer);
    return producer;
}
 
Example 8
Source Project: rocketmq-4.3.0   Source File: BaseConf.java    License: Apache License 2.0 5 votes vote down vote up
public static RMQNormalProducer getProducer(String nsAddr, String topic, String producerGoup,
    String instanceName) {
    RMQNormalProducer producer = new RMQNormalProducer(nsAddr, topic, producerGoup,
        instanceName);
    if (debug) {
        producer.setDebug();
    }
    mqClients.add(producer);
    return producer;
}
 
Example 9
/**
 * @since version3.4.6
 */
@Test
public void testTwoProducerSameGroupAndInstanceName() {
    RMQNormalProducer producer1 = getProducer(nsAddr, topic);
    assertThat(producer1.isStartSuccess()).isEqualTo(true);
    RMQNormalProducer producer2 = getProducer(nsAddr, topic,
        producer1.getProducerGroupName(), producer1.getProducerInstanceName());
    assertThat(producer2.isStartSuccess()).isEqualTo(false);
}
 
Example 10
/**
 * @since version3.4.6
 */
@Test
public void testTwoProducerSameGroup() {
    RMQNormalProducer producer1 = getProducer(nsAddr, topic);
    assertThat(producer1.isStartSuccess()).isEqualTo(true);
    RMQNormalProducer producer2 = getProducer(nsAddr, topic,
        producer1.getProducerGroupName(), RandomUtils.getStringByUUID());
    assertThat(producer2.isStartSuccess()).isEqualTo(true);
}
 
Example 11
Source Project: rocketmq-read   Source File: AbstractMQProducer.java    License: Apache License 2.0 5 votes vote down vote up
public Object getMessageByTag(String tag) {
    Object objMsg = null;
    if (this instanceof RMQNormalProducer) {
        org.apache.rocketmq.common.message.Message msg = new org.apache.rocketmq.common.message.Message(
            topic, (RandomUtil.getStringByUUID() + "." + new Date()).getBytes());
        objMsg = msg;
        if (tag != null) {
            msg.setTags(tag);
        }
    }
    return objMsg;
}
 
Example 12
Source Project: rocketmq-read   Source File: BaseConf.java    License: Apache License 2.0 5 votes vote down vote up
public static RMQNormalProducer getProducer(String nsAddr, String topic, boolean useTLS) {
    RMQNormalProducer producer = new RMQNormalProducer(nsAddr, topic, useTLS);
    if (debug) {
        producer.setDebug();
    }
    mqClients.add(producer);
    return producer;
}
 
Example 13
Source Project: rocketmq-read   Source File: BaseConf.java    License: Apache License 2.0 5 votes vote down vote up
public static RMQNormalProducer getProducer(String nsAddr, String topic, String producerGoup,
    String instanceName) {
    RMQNormalProducer producer = new RMQNormalProducer(nsAddr, topic, producerGoup,
        instanceName);
    if (debug) {
        producer.setDebug();
    }
    mqClients.add(producer);
    return producer;
}
 
Example 14
/**
 * @since version3.4.6
 */
@Test
public void testTwoProducerSameGroupAndInstanceName() {
    RMQNormalProducer producer1 = getProducer(nsAddr, topic);
    assertThat(producer1.isStartSuccess()).isEqualTo(true);
    RMQNormalProducer producer2 = getProducer(nsAddr, topic,
        producer1.getProducerGroupName(), producer1.getProducerInstanceName());
    assertThat(producer2.isStartSuccess()).isEqualTo(false);
}
 
Example 15
/**
 * @since version3.4.6
 */
@Test
public void testTwoProducerSameGroup() {
    RMQNormalProducer producer1 = getProducer(nsAddr, topic);
    assertThat(producer1.isStartSuccess()).isEqualTo(true);
    RMQNormalProducer producer2 = getProducer(nsAddr, topic,
        producer1.getProducerGroupName(), RandomUtils.getStringByUUID());
    assertThat(producer2.isStartSuccess()).isEqualTo(true);
}
 
Example 16
Source Project: rocketmq   Source File: AbstractMQProducer.java    License: Apache License 2.0 5 votes vote down vote up
public Object getMessageByTag(String tag) {
    Object objMsg = null;
    if (this instanceof RMQNormalProducer) {
        org.apache.rocketmq.common.message.Message msg = new org.apache.rocketmq.common.message.Message(
            topic, (RandomUtil.getStringByUUID() + "." + new Date()).getBytes());
        objMsg = msg;
        if (tag != null) {
            msg.setTags(tag);
        }
    }
    return objMsg;
}
 
Example 17
Source Project: rocketmq   Source File: BaseConf.java    License: Apache License 2.0 5 votes vote down vote up
public static RMQNormalProducer getProducer(String nsAddr, String topic) {
    RMQNormalProducer producer = new RMQNormalProducer(nsAddr, topic);
    if (debug) {
        producer.setDebug();
    }
    mqClients.add(producer);
    return producer;
}
 
Example 18
Source Project: rocketmq   Source File: BaseConf.java    License: Apache License 2.0 5 votes vote down vote up
public static RMQNormalProducer getProducer(String nsAddr, String topic, String producerGoup,
    String instanceName) {
    RMQNormalProducer producer = new RMQNormalProducer(nsAddr, topic, producerGoup,
        instanceName);
    if (debug) {
        producer.setDebug();
    }
    mqClients.add(producer);
    return producer;
}
 
Example 19
/**
 * @since version3.4.6
 */
@Test
public void testTwoProducerSameGroupAndInstanceName() {
    RMQNormalProducer producer1 = getProducer(nsAddr, topic);
    assertThat(producer1.isStartSuccess()).isEqualTo(true);
    RMQNormalProducer producer2 = getProducer(nsAddr, topic,
        producer1.getProducerGroupName(), producer1.getProducerInstanceName());
    assertThat(producer2.isStartSuccess()).isEqualTo(false);
}
 
Example 20
/**
 * @since version3.4.6
 */
@Test
public void testTwoProducerSameGroup() {
    RMQNormalProducer producer1 = getProducer(nsAddr, topic);
    assertThat(producer1.isStartSuccess()).isEqualTo(true);
    RMQNormalProducer producer2 = getProducer(nsAddr, topic,
        producer1.getProducerGroupName(), RandomUtils.getStringByUUID());
    assertThat(producer2.isStartSuccess()).isEqualTo(true);
}
 
Example 21
Source Project: DDMQ   Source File: AbstractMQProducer.java    License: Apache License 2.0 5 votes vote down vote up
public Object getMessageByTag(String tag) {
    Object objMsg = null;
    if (this instanceof RMQNormalProducer) {
        org.apache.rocketmq.common.message.Message msg = new org.apache.rocketmq.common.message.Message(
            topic, (RandomUtil.getStringByUUID() + "." + new Date()).getBytes());
        objMsg = msg;
        if (tag != null) {
            msg.setTags(tag);
        }
    }
    return objMsg;
}
 
Example 22
Source Project: DDMQ   Source File: BaseConf.java    License: Apache License 2.0 5 votes vote down vote up
public static RMQNormalProducer getProducer(String nsAddr, String topic, boolean useTLS) {
    RMQNormalProducer producer = new RMQNormalProducer(nsAddr, topic, useTLS);
    if (debug) {
        producer.setDebug();
    }
    mqClients.add(producer);
    return producer;
}
 
Example 23
Source Project: DDMQ   Source File: BaseConf.java    License: Apache License 2.0 5 votes vote down vote up
public static RMQNormalProducer getProducer(String nsAddr, String topic, String producerGoup,
    String instanceName) {
    RMQNormalProducer producer = new RMQNormalProducer(nsAddr, topic, producerGoup,
        instanceName);
    if (debug) {
        producer.setDebug();
    }
    mqClients.add(producer);
    return producer;
}
 
Example 24
/**
 * @since version3.4.6
 */
@Test
public void testTwoProducerSameGroupAndInstanceName() {
    RMQNormalProducer producer1 = getProducer(nsAddr, topic);
    assertThat(producer1.isStartSuccess()).isEqualTo(true);
    RMQNormalProducer producer2 = getProducer(nsAddr, topic,
        producer1.getProducerGroupName(), producer1.getProducerInstanceName());
    assertThat(producer2.isStartSuccess()).isEqualTo(false);
}
 
Example 25
/**
 * @since version3.4.6
 */
@Test
public void testTwoProducerSameGroup() {
    RMQNormalProducer producer1 = getProducer(nsAddr, topic);
    assertThat(producer1.isStartSuccess()).isEqualTo(true);
    RMQNormalProducer producer2 = getProducer(nsAddr, topic,
        producer1.getProducerGroupName(), RandomUtils.getStringByUUID());
    assertThat(producer2.isStartSuccess()).isEqualTo(true);
}
 
Example 26
public Object getMessageByTag(String tag) {
    Object objMsg = null;
    if (this instanceof RMQNormalProducer) {
        org.apache.rocketmq.common.message.Message msg = new org.apache.rocketmq.common.message.Message(
            topic, (RandomUtil.getStringByUUID() + "." + new Date()).getBytes());
        objMsg = msg;
        if (tag != null) {
            msg.setTags(tag);
        }
    }
    return objMsg;
}
 
Example 27
Source Project: rocketmq-all-4.1.0-incubating   Source File: BaseConf.java    License: Apache License 2.0 5 votes vote down vote up
public static RMQNormalProducer getProducer(String nsAddr, String topic) {
    RMQNormalProducer producer = new RMQNormalProducer(nsAddr, topic);
    if (debug) {
        producer.setDebug();
    }
    mqClients.add(producer);
    return producer;
}
 
Example 28
Source Project: rocketmq-all-4.1.0-incubating   Source File: BaseConf.java    License: Apache License 2.0 5 votes vote down vote up
public static RMQNormalProducer getProducer(String nsAddr, String topic, String producerGoup,
    String instanceName) {
    RMQNormalProducer producer = new RMQNormalProducer(nsAddr, topic, producerGoup,
        instanceName);
    if (debug) {
        producer.setDebug();
    }
    mqClients.add(producer);
    return producer;
}
 
Example 29
/**
 * @since version3.4.6
 */
@Test
public void testTwoProducerSameGroupAndInstanceName() {
    RMQNormalProducer producer1 = getProducer(nsAddr, topic);
    assertThat(producer1.isStartSuccess()).isEqualTo(true);
    RMQNormalProducer producer2 = getProducer(nsAddr, topic,
        producer1.getProducerGroupName(), producer1.getProducerInstanceName());
    assertThat(producer2.isStartSuccess()).isEqualTo(false);
}
 
Example 30
/**
 * @since version3.4.6
 */
@Test
public void testTwoProducerSameGroup() {
    RMQNormalProducer producer1 = getProducer(nsAddr, topic);
    assertThat(producer1.isStartSuccess()).isEqualTo(true);
    RMQNormalProducer producer2 = getProducer(nsAddr, topic,
        producer1.getProducerGroupName(), RandomUtils.getStringByUUID());
    assertThat(producer2.isStartSuccess()).isEqualTo(true);
}