当前位置: 首页>>代码示例>>Java>>正文


Java MessageConsumer类代码示例

本文整理汇总了Java中com.networknt.tram.message.consumer.MessageConsumer的典型用法代码示例。如果您正苦于以下问题:Java MessageConsumer类的具体用法?Java MessageConsumer怎么用?Java MessageConsumer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MessageConsumer类属于com.networknt.tram.message.consumer包,在下文中一共展示了MessageConsumer类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: consumerCommandDispatcher

import com.networknt.tram.message.consumer.MessageConsumer; //导入依赖的package包/类
public CommandDispatcher consumerCommandDispatcher() {
    MyTestCommandHandler target = Mockito.spy(new MyTestCommandHandler());
    ChannelMapping channelMapping = SingletonServiceFactory.getBean(ChannelMapping.class);
    MessageConsumer messageConsumer = SingletonServiceFactory.getBean(MessageConsumer.class);
    MessageProducer messageProducer = SingletonServiceFactory.getBean(MessageProducer.class);
    return new CommandDispatcher("customerCommandDispatcher",
            target.defineCommandHandlers(), channelMapping, messageConsumer, messageProducer);
}
 
开发者ID:networknt,项目名称:light-tram-4j,代码行数:9,代码来源:TramCommandsAndEventsServiceInitializer.java

示例2: CommandDispatcher

import com.networknt.tram.message.consumer.MessageConsumer; //导入依赖的package包/类
public CommandDispatcher(String commandDispatcherId,
                         CommandHandlers commandHandlers,
                         ChannelMapping channelMapping,
                         MessageConsumer messageConsumer,
                         MessageProducer messageProducer) {
  this.commandDispatcherId = commandDispatcherId;
  this.commandHandlers = commandHandlers;
  this.channelMapping = channelMapping;
  this.messageConsumer = messageConsumer;
  this.messageProducer = messageProducer;
  initialize();
}
 
开发者ID:networknt,项目名称:light-tram-4j,代码行数:13,代码来源:CommandDispatcher.java

示例3: shouldDispatchCommand

import com.networknt.tram.message.consumer.MessageConsumer; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void shouldDispatchCommand() {
  String commandDispatcherId = "fooId";

  CommandDispatcherTestTarget target = spy(new CommandDispatcherTestTarget());

  ChannelMapping channelMapping = mock(ChannelMapping.class);

  MessageConsumer messageConsumer = mock(MessageConsumer.class);

  MessageProducer messageProducer = mock(MessageProducer.class);

  CommandDispatcher dispatcher = new CommandDispatcher(commandDispatcherId,
          defineCommandHandlers(target),
          channelMapping,
          messageConsumer,
          messageProducer);

  String customerId = "customer0";
  String resource = "/customers/" + customerId;
  Command command = new TestCommand();

  String replyTo = "replyTo-xxx";

  String channel = "myChannel";

  Message message = CommandProducerImpl.makeMessage(channel, resource, command, replyTo, singletonMap(Message.ID, "999"));

  dispatcher.messageHandler(message);

  verify(target).reserveCredit(any(CommandMessage.class), any(PathVariables.class));
  verify(messageProducer).send(any(), any());
  verifyNoMoreInteractions(messageProducer, target);
}
 
开发者ID:networknt,项目名称:light-tram-4j,代码行数:36,代码来源:CommandDispatcherTest.java

示例4: getCustomerCommandDispatcher

import com.networknt.tram.message.consumer.MessageConsumer; //导入依赖的package包/类
public static CommandDispatcher getCustomerCommandDispatcher() {
    CustomerCommandHandler customerCommandHandler = SingletonServiceFactory.getBean(CustomerCommandHandler.class);
    ChannelMapping channelMapping = SingletonServiceFactory.getBean(ChannelMapping.class);
    MessageProducer messageProducer =  SingletonServiceFactory.getBean(MessageProducer.class);
    MessageConsumer messageConsumer =  SingletonServiceFactory.getBean(MessageConsumer.class);
    SagaLockManager sagaLockManager = SingletonServiceFactory.getBean(SagaLockManager.class);
    return new SagaCommandDispatcher("customerCommandDispatcher",
            customerCommandHandler.commandHandlerDefinitions(),
            channelMapping,
            messageConsumer,
            messageProducer,
            sagaLockManager);
}
 
开发者ID:networknt,项目名称:light-saga-4j,代码行数:14,代码来源:ComponentFactory.java

示例5: getOrderCommandDispatcher

import com.networknt.tram.message.consumer.MessageConsumer; //导入依赖的package包/类
public static CommandDispatcher getOrderCommandDispatcher() {
    OrderCommandHandler orderCommandHandler = SingletonServiceFactory.getBean(OrderCommandHandler.class);
    ChannelMapping channelMapping = SingletonServiceFactory.getBean(ChannelMapping.class);
    MessageProducer messageProducer = SingletonServiceFactory.getBean(MessageProducer.class);
    MessageConsumer messageConsumer = SingletonServiceFactory.getBean(MessageConsumer.class);
    SagaLockManager sagaLockManager = SingletonServiceFactory.getBean(SagaLockManager.class);
    return new SagaCommandDispatcher("orderCommandDispatcher",
            orderCommandHandler.commandHandlerDefinitions(),
            channelMapping,
            messageConsumer,
            messageProducer,
            sagaLockManager);

}
 
开发者ID:networknt,项目名称:light-saga-4j,代码行数:15,代码来源:ComponentFactory.java

示例6: onStartup

import com.networknt.tram.message.consumer.MessageConsumer; //导入依赖的package包/类
@Override
public void onStartup() {
	MessageConsumer messageConsumer =  (MessageConsumer) SingletonServiceFactory.getBean(MessageConsumer.class);
	TodoEventConsumer todoEventConsumer =  (TodoEventConsumer) SingletonServiceFactory.getBean(TodoEventConsumer.class);
	domainEventDispatcher = new DomainEventDispatcher("todoServiceEvents", todoEventConsumer.domainEventHandlers(), messageConsumer);
	domainEventDispatcher.initialize();
}
 
开发者ID:networknt,项目名称:light-example-4j,代码行数:8,代码来源:StartUpTramMessageDispacher.java

示例7: myReplyConsumer

import com.networknt.tram.message.consumer.MessageConsumer; //导入依赖的package包/类
public MyReplyConsumer myReplyConsumer() {
    MessageConsumer messageConsumer = SingletonServiceFactory.getBean(MessageConsumer.class);
    return new MyReplyConsumer(messageConsumer, "ReplyTo");
}
 
开发者ID:networknt,项目名称:light-tram-4j,代码行数:5,代码来源:TramCommandsAndEventsServiceInitializer.java

示例8: MyReplyConsumer

import com.networknt.tram.message.consumer.MessageConsumer; //导入依赖的package包/类
public MyReplyConsumer(MessageConsumer messageConsumer, String replyChannel) {
  this.messageConsumer = messageConsumer;
  this.replyChannel = replyChannel;
  subscribe();
}
 
开发者ID:networknt,项目名称:light-tram-4j,代码行数:6,代码来源:MyReplyConsumer.java

示例9: DomainEventDispatcher

import com.networknt.tram.message.consumer.MessageConsumer; //导入依赖的package包/类
public DomainEventDispatcher(String eventDispatcherId, DomainEventHandlers domainEventHandlers, MessageConsumer messageConsumer) {
  this.eventDispatcherId = eventDispatcherId;
  this.domainEventHandlers = domainEventHandlers;
  this.messageConsumer = messageConsumer;
}
 
开发者ID:networknt,项目名称:light-tram-4j,代码行数:6,代码来源:DomainEventDispatcher.java

示例10: SagaCommandDispatcher

import com.networknt.tram.message.consumer.MessageConsumer; //导入依赖的package包/类
public SagaCommandDispatcher(String commandDispatcherId, CommandHandlers target, ChannelMapping channelMapping,
                             MessageConsumer messageConsumer, MessageProducer messageProducer, SagaLockManager sagaLockManager) {
  super(commandDispatcherId, target, channelMapping, messageConsumer, messageProducer);
  this.sagaLockManager = sagaLockManager;
}
 
开发者ID:networknt,项目名称:light-saga-4j,代码行数:6,代码来源:SagaCommandDispatcher.java


注:本文中的com.networknt.tram.message.consumer.MessageConsumer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。