Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-1962

Connection should be closed in case start() throws exception

Details

    • Bug
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • None
    • Not applicable
    • io-java-jms
    • None

    Description

      In JmsIO#start() :

            try {
              Connection connection;
              if (spec.getUsername() != null) {
                connection =
                    connectionFactory.createConnection(spec.getUsername(), spec.getPassword());
              } else {
                connection = connectionFactory.createConnection();
              }
              connection.start();
              this.connection = connection;
            } catch (Exception e) {
              throw new IOException("Error connecting to JMS", e);
            }
      

      If start() throws exception, connection should be closed.

      Attachments

        Activity

          People

            Unassigned Unassigned
            yuzhihong@gmail.com Ted Yu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: