Codota Logo
BrokerRunning.getConnection
Code IndexAdd Codota to your IDE (free)

How to use
getConnection
method
in
org.springframework.amqp.rabbit.junit.BrokerRunning

Best Java code snippets using org.springframework.amqp.rabbit.junit.BrokerRunning.getConnection (Showing top 8 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-amqp

/**
 * Remove any test queues that were created by an
 * {@link #isRunningWithEmptyQueues(String...)} method.
 * @param additionalQueues additional queues to remove that might have been created by
 * tests.
 */
public void removeTestQueues(String... additionalQueues) {
  List<String> queuesToRemove = Arrays.asList(this.queues);
  if (additionalQueues != null) {
    queuesToRemove = new ArrayList<>(queuesToRemove);
    queuesToRemove.addAll(Arrays.asList(additionalQueues));
  }
  logger.debug("deleting test queues: " + queuesToRemove);
  Connection connection = null; // NOSONAR (closeResources())
  Channel channel = null;
  try {
    connection = getConnection(getConnectionFactory());
    connection.setId(generateId() + ".queueDelete");
    channel = connection.createChannel();
    for (String queue : queuesToRemove) {
      channel.queueDelete(queue);
    }
  }
  catch (Exception e) {
    logger.warn("Failed to delete queues", e);
  }
  finally {
    closeResources(connection, channel);
  }
}
origin: spring-projects/spring-amqp

/**
 * Delete arbitrary queues from the broker.
 * @param queues the queues to delete.
 */
public void deleteQueues(String... queues) {
  Connection connection = null; // NOSONAR (closeResources())
  Channel channel = null;
  try {
    connection = getConnection(getConnectionFactory());
    connection.setId(generateId() + ".queueDelete");
    channel = connection.createChannel();
    for (String queue : queues) {
      channel.queueDelete(queue);
    }
  }
  catch (Exception e) {
    logger.warn("Failed to delete queues", e);
  }
  finally {
    closeResources(connection, channel);
  }
}
origin: org.springframework.amqp/spring-rabbit-junit

/**
 * Remove any test queues that were created by an
 * {@link #isRunningWithEmptyQueues(String...)} method.
 * @param additionalQueues additional queues to remove that might have been created by
 * tests.
 */
public void removeTestQueues(String... additionalQueues) {
  List<String> queuesToRemove = Arrays.asList(this.queues);
  if (additionalQueues != null) {
    queuesToRemove = new ArrayList<>(queuesToRemove);
    queuesToRemove.addAll(Arrays.asList(additionalQueues));
  }
  logger.debug("deleting test queues: " + queuesToRemove);
  Connection connection = null; // NOSONAR (closeResources())
  Channel channel = null;
  try {
    connection = getConnection(getConnectionFactory());
    connection.setId(generateId() + ".queueDelete");
    channel = connection.createChannel();
    for (String queue : queuesToRemove) {
      channel.queueDelete(queue);
    }
  }
  catch (Exception e) {
    logger.warn("Failed to delete queues", e);
  }
  finally {
    closeResources(connection, channel);
  }
}
origin: spring-projects/spring-amqp

/**
 * Delete arbitrary exchanges from the broker.
 * @param exchanges the exchanges to delete.
 */
public void deleteExchanges(String... exchanges) {
  Connection connection = null; // NOSONAR (closeResources())
  Channel channel = null;
  try {
    connection = getConnection(getConnectionFactory());
    connection.setId(generateId() + ".exchangeDelete");
    channel = connection.createChannel();
    for (String exchange : exchanges) {
      channel.exchangeDelete(exchange);
    }
  }
  catch (Exception e) {
    logger.warn("Failed to delete queues", e);
  }
  finally {
    closeResources(connection, channel);
  }
}
origin: org.springframework.amqp/spring-rabbit-junit

/**
 * Delete arbitrary exchanges from the broker.
 * @param exchanges the exchanges to delete.
 */
public void deleteExchanges(String... exchanges) {
  Connection connection = null; // NOSONAR (closeResources())
  Channel channel = null;
  try {
    connection = getConnection(getConnectionFactory());
    connection.setId(generateId() + ".exchangeDelete");
    channel = connection.createChannel();
    for (String exchange : exchanges) {
      channel.exchangeDelete(exchange);
    }
  }
  catch (Exception e) {
    logger.warn("Failed to delete queues", e);
  }
  finally {
    closeResources(connection, channel);
  }
}
origin: org.springframework.amqp/spring-rabbit-junit

/**
 * Delete arbitrary queues from the broker.
 * @param queues the queues to delete.
 */
public void deleteQueues(String... queues) {
  Connection connection = null; // NOSONAR (closeResources())
  Channel channel = null;
  try {
    connection = getConnection(getConnectionFactory());
    connection.setId(generateId() + ".queueDelete");
    channel = connection.createChannel();
    for (String queue : queues) {
      channel.queueDelete(queue);
    }
  }
  catch (Exception e) {
    logger.warn("Failed to delete queues", e);
  }
  finally {
    closeResources(connection, channel);
  }
}
origin: spring-projects/spring-amqp

connection = getConnection(getConnectionFactory());
channel = createQueues(connection);
origin: org.springframework.amqp/spring-rabbit-junit

connection = getConnection(getConnectionFactory());
channel = createQueues(connection);
org.springframework.amqp.rabbit.junitBrokerRunninggetConnection

Javadoc

Get the connection factory used by this rule.

Popular methods of BrokerRunning

  • getConnectionFactory
    Get the connection factory used by this rule.
  • removeTestQueues
    Remove any test queues that were created by an #isRunningWithEmptyQueues(String...) method.
  • getAdminUri
    Return the admin uri.
  • setPort
  • <init>
  • closeResources
  • createQueues
  • deleteExchanges
    Delete arbitrary exchanges from the broker.
  • fatal
  • generateId
    Generate the connection id for the connection used by the rule's connection factory.
  • isBrokerAndManagementRunningWithEmptyQueues
  • isDefaultQueue
  • isBrokerAndManagementRunningWithEmptyQueues,
  • isDefaultQueue,
  • isRunningWithEmptyQueues,
  • isUp,
  • setHostName,
  • clearEnvironmentVariableOverrides,
  • deleteQueues,
  • getHostName,
  • getPassword

Popular in Java

  • Running tasks concurrently on multiple threads
  • findViewById (Activity)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • notifyDataSetChanged (ArrayAdapter)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • TreeSet (java.util)
    A NavigableSet implementation based on a TreeMap. The elements are ordered using their Comparable, o
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now