ProjectEventConst.java 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. package jnpf.consts;
  2. /**
  3. * 自定义事件常量
  4. */
  5. public class ProjectEventConst {
  6. public static final String DEFAULT_TOPIC_NAME = "defMsgToptic";
  7. /**
  8. * 自定义通知渠道 Redis
  9. */
  10. public static final String EVENT_PUBLISH_TYPE_REDIS = "redis";
  11. /**
  12. * 自定义通知渠道 MQ
  13. */
  14. public static final String EVENT_PUBLISH_TYPE_QUEUE = "mq";
  15. /**
  16. * Redis事件监听模式, 当前DB
  17. */
  18. public static final String REDIS_PUBLISH_TYPE_CURRENT = "current";
  19. /**
  20. * Redis事件监听模式, 相同Redis(全部DB) 多个环境使用相同的Redis实例都会触发事件
  21. */
  22. public static final String REDIS_PUBLISH_TYPE_ALL = "all";
  23. /**
  24. * Redis事件消息监听前缀
  25. */
  26. public static final String DEFAULT_CHANNEL_PREFIX = "myevent_";
  27. /**
  28. * 集群消费, 只有一个服务消费成功
  29. */
  30. public static final int EVENT_PUBLISH_MODEL_CLUSTERING = 1;
  31. /**
  32. * 广播消费, 所有服务都可以消费
  33. */
  34. public static final int EVENT_PUBLISH_MODEL_BROADCASTING = 2;
  35. /**
  36. * 本地消息, 只在当前进程触发事件
  37. */
  38. public static final int EVENT_PUBLISH_MODEL_LOCAL = 3;
  39. }