Examples of receiveAndConvert()


Examples of org.springframework.jms.core.JmsTemplate.receiveAndConvert()

  protected void checkIfMessageNotExist() {
    JmsTemplate template=new JmsTemplate(getConnectionFactory());
    template.setReceiveTimeout(10);
    String receivedMessage=null;
    receivedMessage=(String)template.receiveAndConvert(queue);
    assertNull(receivedMessage);
  }
}
View Full Code Here

Examples of org.springframework.jms.core.JmsTemplate.receiveAndConvert()

  }

  private void checkIfMessageExist(String sentMessage) {
    JmsTemplate template=new JmsTemplate(getConnectionFactory());
    template.setReceiveTimeout(10);
    String receivedMessage=(String)template.receiveAndConvert(queue);
    assertEquals(sentMessage,receivedMessage);
  }

  private void checkIfMessageNotExist() {
    JmsTemplate template=new JmsTemplate(getConnectionFactory());
View Full Code Here

Examples of org.springframework.jms.core.JmsTemplate.receiveAndConvert()

  private void checkIfMessageNotExist() {
    JmsTemplate template=new JmsTemplate(getConnectionFactory());
    template.setReceiveTimeout(10);
    String receivedMessage=null;
    receivedMessage=(String)template.receiveAndConvert(queue);
    assertNull(receivedMessage);
  }

  public void testOutboundWithCommit() throws Exception {
    //Update the field and send a JMS message in a JTA transaction
View Full Code Here

Examples of org.springframework.jms.core.JmsTemplate.receiveAndConvert()

    TransactionTemplate tt = new TransactionTemplate(getTransactionManager());
    tt.execute(new TransactionCallback() {
      public Object doInTransaction(TransactionStatus status) {
        JmsTemplate template=new JmsTemplate(getConnectionFactory());
        template.setReceiveTimeout(10);
        String receivedMessage=(String)template.receiveAndConvert(getQueue());
        assertEquals(sentMessage,receivedMessage);
        return null;
      }
    });
  }
View Full Code Here

Examples of org.springframework.jms.core.JmsTemplate.receiveAndConvert()

    tt.execute(new TransactionCallback() {
      public Object doInTransaction(TransactionStatus status) {
        JmsTemplate template=new JmsTemplate(getConnectionFactory());
        template.setReceiveTimeout(10);
        String receivedMessage=null;
        receivedMessage=(String)template.receiveAndConvert(getQueue());
        assertNull(receivedMessage);
        return null;
      }
    });
  }
View Full Code Here

Examples of org.springframework.jms.core.JmsTemplate.receiveAndConvert()

//              System.out.println(mmsg.getLong("acctId") + ", " +
//                  mmsg.getString("side") + ", " +
//                  mmsg.getString("symbol") + ", " +
//                  mmsg.getDouble("shares"));
//            }
            Object msg = jmsTemplate.receiveAndConvert();
            if (msg instanceof String) {
              System.out.println("Received: " + msg);
            }
            counter++;
      }
View Full Code Here

Examples of org.springframework.jms.core.JmsTemplate.receiveAndConvert()

              System.out.println("Selector: " + messageSelector);
              Object obj = null;
              if(messageSelector != null && !"".equals(messageSelector)){
                obj = sender.receiveSelectedAndConvert(messageSelector);
              }else{
                obj = sender.receiveAndConvert();
              }
             
              if(obj != null){
                result.setSuccessful(true);
                result.setResponseData(obj.toString().getBytes());
View Full Code Here

Examples of org.springframework.jms.core.JmsTemplate.receiveAndConvert()

      public Void doInTransaction(org.springframework.transaction.TransactionStatus status) {

        repeatTemplate.iterate(new RepeatCallback() {
          @Override
          public RepeatStatus doInIteration(RepeatContext context) throws Exception {
            String text = (String) txJmsTemplate.receiveAndConvert("queue");
            list.add(text);
            jdbcTemplate.update("INSERT into T_BARS (id,name,foo_date) values (?,?,null)", list.size(), text);
            return RepeatStatus.continueIf(text != null);
          }
        });
View Full Code Here

Examples of org.springframework.jms.core.JmsTemplate.receiveAndConvert()

    });

    String text = "";
    List<String> msgs = new ArrayList<String>();
    while (text != null) {
      text = (String) txJmsTemplate.receiveAndConvert("queue");
      msgs.add(text);
    }

    // The database portion committed...
    int count = jdbcTemplate.queryForObject("select count(*) from T_BARS", Integer.class);
View Full Code Here

Examples of org.springframework.jms.core.JmsTemplate.receiveAndConvert()

            return null;
        }
        LOGGER.info("waiting {}ms for response on call with id {}", timeout, callId);
        JmsTemplate createJMSTemplate = createJMSTemplate(destination);
        createJMSTemplate.setReceiveTimeout(timeout);
        Object receiveAndConvert = createJMSTemplate.receiveAndConvert(callId);
        if (receiveAndConvert == null) {
            throw new RuntimeException("JMS Receive Timeout reached");
        }
        LOGGER.info("response for call with id {} received", callId);
        return (String) receiveAndConvert;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.