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

The following examples show how to use org.apache.rocketmq.test.client.rmq.RMQNormalProducer. 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 File: ProducerGroupAndInstanceNameValidityIT.java    From rocketmq-all-4.1.0-incubating with Apache License 2.0 5 votes vote down vote up
/**
 * @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 #2
Source File: AbstractMQProducer.java    From DDMQ with 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 #3
Source File: AbstractMQProducer.java    From DDMQ with 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 #4
Source File: BaseConf.java    From DDMQ with 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 #5
Source File: BaseConf.java    From DDMQ with 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 #6
Source File: ProducerGroupAndInstanceNameValidityIT.java    From DDMQ with Apache License 2.0 5 votes vote down vote up
/**
 * @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 #7
Source File: ProducerGroupAndInstanceNameValidityIT.java    From DDMQ with Apache License 2.0 5 votes vote down vote up
/**
 * @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 #8
Source File: AbstractMQProducer.java    From rocketmq-all-4.1.0-incubating with 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 #9
Source File: BaseConf.java    From rocketmq-all-4.1.0-incubating with 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 #10
Source File: BaseConf.java    From rocketmq-all-4.1.0-incubating with 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 #11
Source File: ProducerGroupAndInstanceNameValidityIT.java    From rocketmq-all-4.1.0-incubating with Apache License 2.0 5 votes vote down vote up
/**
 * @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 #12
Source File: ProducerGroupAndInstanceNameValidityIT.java    From rocketmq with Apache License 2.0 5 votes vote down vote up
/**
 * @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 #13
Source File: AbstractMQProducer.java    From rocketmq_trans_message with 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 #14
Source File: BaseConf.java    From rocketmq_trans_message with 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 #15
Source File: BaseConf.java    From rocketmq_trans_message with 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 #16
Source File: ProducerGroupAndInstanceNameValidityIT.java    From rocketmq_trans_message with Apache License 2.0 5 votes vote down vote up
/**
 * @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 #17
Source File: ProducerGroupAndInstanceNameValidityIT.java    From rocketmq_trans_message with Apache License 2.0 5 votes vote down vote up
/**
 * @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 #18
Source File: AbstractMQProducer.java    From rocketmq with 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 #19
Source File: BaseConf.java    From rocketmq with 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 #20
Source File: BaseConf.java    From rocketmq with 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 #21
Source File: ProducerGroupAndInstanceNameValidityIT.java    From rocketmq with Apache License 2.0 5 votes vote down vote up
/**
 * @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 #22
Source File: ProducerGroupAndInstanceNameValidityIT.java    From rocketmq with Apache License 2.0 5 votes vote down vote up
/**
 * @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 #23
Source File: BaseConf.java    From rocketmq with 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
Source File: BaseConf.java    From DDMQ with 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 #25
Source File: BaseConf.java    From DDMQ with 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 #26
Source File: ProducerGroupAndInstanceNameValidityIT.java    From DDMQ with Apache License 2.0 5 votes vote down vote up
/**
 * @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 #27
Source File: ProducerGroupAndInstanceNameValidityIT.java    From DDMQ with Apache License 2.0 5 votes vote down vote up
/**
 * @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 #28
Source File: AbstractMQProducer.java    From rocketmq-4.3.0 with 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 #29
Source File: BaseConf.java    From rocketmq-4.3.0 with 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 #30
Source File: BaseConf.java    From rocketmq-4.3.0 with 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;
}