All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.redkalex.mq.kafka.KafkaMessageAgentProvider Maven / Gradle / Ivy

There is a newer version: 2.7.7
Show newest version
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.redkalex.mq.kafka;

import org.redkale.annotation.Priority;
import org.redkale.mq.spi.MessageAgent;
import org.redkale.mq.spi.MessageAgentProvider;
import org.redkale.util.*;

/** @author zhangjx */
@Priority(-800)
public class KafkaMessageAgentProvider implements MessageAgentProvider {

    @Override
    public boolean acceptsConf(AnyValue config) {
        try {
            Object.class.isAssignableFrom(org.apache.kafka.clients.CommonClientConfigs.class); // 试图加载相关类
            return new KafkaMessageAgent().acceptsConf(config);
        } catch (Throwable t) {
            return false;
        }
    }

    @Override
    public MessageAgent createInstance() {
        return new KafkaMessageAgent();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy