删除:producer 的 send 方法
This commit is contained in:
parent
3e91d785e3
commit
f4ed1b05d0
@ -5,8 +5,5 @@ import java.util.logging.Logger;
|
|||||||
public interface IProducer {
|
public interface IProducer {
|
||||||
Logger logger = Logger.getLogger(IProducer.class.getSimpleName());
|
Logger logger = Logger.getLogger(IProducer.class.getSimpleName());
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
<T extends Event> void send(T t);
|
|
||||||
|
|
||||||
<V> void publish(String topic, V v);
|
<V> void publish(String topic, V v);
|
||||||
}
|
}
|
||||||
|
@ -35,9 +35,6 @@ public abstract class KafakConsumer extends AbstractConsumer implements IConsume
|
|||||||
|
|
||||||
protected Properties props;
|
protected Properties props;
|
||||||
|
|
||||||
// 0:none 1:restart -1:stop
|
|
||||||
//private int cmd = -1;
|
|
||||||
|
|
||||||
public abstract String getGroupid();
|
public abstract String getGroupid();
|
||||||
|
|
||||||
private final LinkedBlockingQueue<Runnable> queue = new LinkedBlockingQueue<>();
|
private final LinkedBlockingQueue<Runnable> queue = new LinkedBlockingQueue<>();
|
||||||
|
@ -40,7 +40,7 @@ public class KafakProducer implements IProducer, Service {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
/*@Deprecated
|
||||||
@Override
|
@Override
|
||||||
public <T extends Event> void send(T t) {
|
public <T extends Event> void send(T t) {
|
||||||
String v = JsonConvert.root().convertTo(t.value);
|
String v = JsonConvert.root().convertTo(t.value);
|
||||||
@ -48,7 +48,7 @@ public class KafakProducer implements IProducer, Service {
|
|||||||
v = v.substring(1, v.length() - 1);
|
v = v.substring(1, v.length() - 1);
|
||||||
}
|
}
|
||||||
producer.send(new ProducerRecord(t.topic, v));
|
producer.send(new ProducerRecord(t.topic, v));
|
||||||
}
|
}*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <V> void publish(String topic, V v) {
|
public <V> void publish(String topic, V v) {
|
||||||
|
@ -39,22 +39,6 @@ public class RedisProducer implements IProducer, Service {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
@Override
|
|
||||||
public <T extends Event> void send(T t) {
|
|
||||||
try {
|
|
||||||
String v = JsonConvert.root().convertTo(t.value);
|
|
||||||
if (v.startsWith("\"") && v.endsWith("\"")) {
|
|
||||||
v = v.substring(1, v.length() - 1);
|
|
||||||
}
|
|
||||||
osw.write("PUBLISH " + t.topic + " '" + v + "' \r\n");
|
|
||||||
osw.flush();
|
|
||||||
} catch (IOException e) {
|
|
||||||
logger.log(Level.WARNING, "", e);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <V> void publish(String topic, V v) {
|
public <V> void publish(String topic, V v) {
|
||||||
try {
|
try {
|
||||||
|
@ -138,15 +138,6 @@ public abstract class ZHubClient extends AbstractConsumer implements IConsumer,
|
|||||||
return JsonConvert.root().convertTo(v);
|
return JsonConvert.root().convertTo(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public void send(Event t) {
|
|
||||||
String v = JsonConvert.root().convertTo(t.value);
|
|
||||||
if (v.startsWith("\"") && v.endsWith("\"")) {
|
|
||||||
v = v.substring(1, v.length() - 1);
|
|
||||||
}
|
|
||||||
send("publish", t.topic, v);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean initSocket() {
|
public boolean initSocket() {
|
||||||
try {
|
try {
|
||||||
client = new Socket();
|
client = new Socket();
|
||||||
|
Loading…
Reference in New Issue
Block a user