Search in sources :

Example 1 with MQProducerWrapper

use of org.apache.eventmesh.runtime.core.plugin.MQProducerWrapper in project incubator-eventmesh by apache.

the class EventMeshProducer method init.

public synchronized void init(EventMeshHTTPConfiguration eventMeshHttpConfiguration, ProducerGroupConf producerGroupConfig) throws Exception {
    this.producerGroupConfig = producerGroupConfig;
    this.eventMeshHttpConfiguration = eventMeshHttpConfiguration;
    Properties keyValue = new Properties();
    keyValue.put("producerGroup", producerGroupConfig.getGroupName());
    keyValue.put("instanceName", EventMeshUtil.buildMeshClientID(producerGroupConfig.getGroupName(), eventMeshHttpConfiguration.eventMeshCluster));
    // TODO for defibus
    keyValue.put("eventMeshIDC", eventMeshHttpConfiguration.eventMeshIDC);
    mqProducerWrapper = new MQProducerWrapper(eventMeshHttpConfiguration.eventMeshConnectorPluginType);
    mqProducerWrapper.init(keyValue);
    inited.compareAndSet(false, true);
    logger.info("EventMeshProducer [{}] inited.............", producerGroupConfig.getGroupName());
}
Also used : MQProducerWrapper(org.apache.eventmesh.runtime.core.plugin.MQProducerWrapper) Properties(java.util.Properties)

Example 2 with MQProducerWrapper

use of org.apache.eventmesh.runtime.core.plugin.MQProducerWrapper in project incubator-eventmesh by apache.

the class EventMeshProducer method init.

public synchronized void init(EventMeshGrpcConfiguration eventMeshGrpcConfiguration, ProducerGroupConf producerGroupConfig) throws Exception {
    this.producerGroupConfig = producerGroupConfig;
    Properties keyValue = new Properties();
    keyValue.put("producerGroup", producerGroupConfig.getGroupName());
    keyValue.put("instanceName", EventMeshUtil.buildMeshClientID(producerGroupConfig.getGroupName(), eventMeshGrpcConfiguration.eventMeshCluster));
    // TODO for defibus
    keyValue.put("eventMeshIDC", eventMeshGrpcConfiguration.eventMeshIDC);
    mqProducerWrapper = new MQProducerWrapper(eventMeshGrpcConfiguration.eventMeshConnectorPluginType);
    mqProducerWrapper.init(keyValue);
    serviceState = ServiceState.INITED;
    logger.info("EventMeshProducer [{}] inited...........", producerGroupConfig.getGroupName());
}
Also used : MQProducerWrapper(org.apache.eventmesh.runtime.core.plugin.MQProducerWrapper) Properties(java.util.Properties)

Aggregations

Properties (java.util.Properties)2 MQProducerWrapper (org.apache.eventmesh.runtime.core.plugin.MQProducerWrapper)2