@Test public void testPutMessageException() throws TException { doThrow(new GalaxyTalosException()).doReturn(new PutMessageResponse()) .when(messageClientMock).putMessage(any(PutMessageRequest.class)); when(scheduleInfoCacheMock.getOrCreateMessageClient(any(TopicAndPartition.class))) .thenReturn(messageClientMock); boolean putSuccess = simpleProducer.putMessage(messageList); assertFalse(putSuccess); while (!putSuccess) { putSuccess = simpleProducer.putMessage(messageList); assertTrue(putSuccess); } InOrder inOrder = inOrder(messageClientMock); inOrder.verify(messageClientMock, times(2)).putMessage( any(PutMessageRequest.class)); inOrder.verifyNoMoreInteractions(); }
@Deprecated public boolean putMessage(List<Message> msgList) { if (msgList == null || msgList.size() == 0) { return true; } try { putMessageList(msgList); return true; } catch (Exception e) { LOG.error("putMessage error: " + ", please try to put again", e); } return false; }
SimpleProducer { @Deprecated public boolean putMessage(List<Message> msgList) { if (msgList == null || msgList.size() == 0) { return true; } try { putMessageList(msgList); return true; } catch (Exception e) { LOG.error("putMessage error: " + ", please try to put again", e); } return false; } }
SimpleProducer { @Deprecated public boolean putMessage(List<Message> msgList) { if (msgList == null || msgList.size() == 0) { return true; } try { putMessageList(msgList); return true; } catch (Exception e) { LOG.error("putMessage error: " + ", please try to put again", e); } return false; } SimpleProducer(TalosProducerConfig producerConfig,
      TopicAndPartition topicAndPartition, MessageService.Iface messageClient,
      String clientId, AtomicLong requestId);  SimpleProducer(TalosProducerConfig producerConfig,
      TopicAndPartition topicAndPartition, MessageService.Iface messageClient,
      AtomicLong requestId);  SimpleProducer(TalosProducerConfig producerConfig,
      TopicAndPartition topicAndPartition, TalosClientFactory talosClientFactory,
      AtomicLong requestId);  SimpleProducer(TalosProducerConfig producerConfig, String topicName,
      int partitionId, Credential credential); @Deprecated  SimpleProducer(TalosProducerConfig producerConfig,
      TopicAndPartition topicAndPartition, Credential credential);  SimpleProducer(TalosProducerConfig producerConfig,
      String topicName, int partitionId, TalosClientFactory talosClientFactory,
      String clientId, AtomicLong requestId);  SimpleProducer(TalosProducerConfig producerConfig,
      TopicAndPartition topicAndPartition, TalosClientFactory talosClientFactory,
      MessageService.Iface messageClient, String clientId, AtomicLong requestId);  SimpleProducer(TalosProducerConfig producerConfig, String topicName,
      int partitionId, MessageService.Iface messageClientMock,
      TopicService.Iface topicClient, AtomicLong requestId,
      ScheduleInfoCache scheduleInfoCacheMock); }
SimpleProducer { @Deprecated public boolean putMessage(List<Message> msgList) { if (msgList == null || msgList.size() == 0) { return true; } try { putMessageList(msgList); return true; } catch (Exception e) { LOG.error("putMessage error: " + ", please try to put again", e); } return false; } SimpleProducer(TalosProducerConfig producerConfig,
      TopicAndPartition topicAndPartition, MessageService.Iface messageClient,
      String clientId, AtomicLong requestId);  SimpleProducer(TalosProducerConfig producerConfig,
      TopicAndPartition topicAndPartition, MessageService.Iface messageClient,
      AtomicLong requestId);  SimpleProducer(TalosProducerConfig producerConfig,
      TopicAndPartition topicAndPartition, TalosClientFactory talosClientFactory,
      AtomicLong requestId);  SimpleProducer(TalosProducerConfig producerConfig, String topicName,
      int partitionId, Credential credential); @Deprecated  SimpleProducer(TalosProducerConfig producerConfig,
      TopicAndPartition topicAndPartition, Credential credential);  SimpleProducer(TalosProducerConfig producerConfig,
      String topicName, int partitionId, TalosClientFactory talosClientFactory,
      String clientId, AtomicLong requestId);  SimpleProducer(TalosProducerConfig producerConfig,
      TopicAndPartition topicAndPartition, TalosClientFactory talosClientFactory,
      MessageService.Iface messageClient, String clientId, AtomicLong requestId);  SimpleProducer(TalosProducerConfig producerConfig, String topicName,
      int partitionId, MessageService.Iface messageClientMock,
      TopicService.Iface topicClient, AtomicLong requestId,
      ScheduleInfoCache scheduleInfoCacheMock); @Deprecated boolean putMessage(List<Message> msgList); void putMessageList(List<Message> msgList); void shutDown(); }
SimpleProducer { @Deprecated public boolean putMessage(List<Message> msgList) { if (msgList == null || msgList.size() == 0) { return true; } try { putMessageList(msgList); return true; } catch (Exception e) { LOG.error("putMessage error: " + ", please try to put again", e); } return false; } SimpleProducer(TalosProducerConfig producerConfig,
      TopicAndPartition topicAndPartition, MessageService.Iface messageClient,
      String clientId, AtomicLong requestId);  SimpleProducer(TalosProducerConfig producerConfig,
      TopicAndPartition topicAndPartition, MessageService.Iface messageClient,
      AtomicLong requestId);  SimpleProducer(TalosProducerConfig producerConfig,
      TopicAndPartition topicAndPartition, TalosClientFactory talosClientFactory,
      AtomicLong requestId);  SimpleProducer(TalosProducerConfig producerConfig, String topicName,
      int partitionId, Credential credential); @Deprecated  SimpleProducer(TalosProducerConfig producerConfig,
      TopicAndPartition topicAndPartition, Credential credential);  SimpleProducer(TalosProducerConfig producerConfig,
      String topicName, int partitionId, TalosClientFactory talosClientFactory,
      String clientId, AtomicLong requestId);  SimpleProducer(TalosProducerConfig producerConfig,
      TopicAndPartition topicAndPartition, TalosClientFactory talosClientFactory,
      MessageService.Iface messageClient, String clientId, AtomicLong requestId);  SimpleProducer(TalosProducerConfig producerConfig, String topicName,
      int partitionId, MessageService.Iface messageClientMock,
      TopicService.Iface topicClient, AtomicLong requestId,
      ScheduleInfoCache scheduleInfoCacheMock); @Deprecated boolean putMessage(List<Message> msgList); void putMessageList(List<Message> msgList); void shutDown();  }