How to disable the automatic queue creation with amqp qpid jms client

Options
jfg1306
jfg1306 Member Posts: 12
edited May 2023 in General Discussions #1

Hello everyone,

I am following the tutorial provided here: GitHub - SolaceSamples/solace-samples-amqp-qpid-jms1: Getting Started tutorials for using Apache Qpid JMS 1.1 over AMQP 1.0 with Solace Message Routers.

I want to create a consumer on my queue which receives messages. This does work, however everytime the client connects, the Broker throws a warning:

2023-05-15T13:48:52.746+00:00 <local3.notice> : CLIENT: CLIENT_CLIENT_CREATE_ENDPOINT_FAILED: [...] failed, reason: Endpoint Property Mismatch

The Queue already exists on the Broker (with different settings) so the property mismatch makes sense. But I would like the client to not try to create the endpoint whatsoever.

I know there are settings on the Client Profile to enable the Client to create Endpoints "on-the-fly" but as I said in my case this queue already exists and I would like to prevent this error.

I am using (from the example) the Qpid JMS - Apache Qpid™.


        final String QUEUE_NAME = "Q/name";
        String solaceHost = "amqps://secreturl:port";
        String solaceUsername = "pepl-dev-client-user";
        String solacePassword = "secret";
        System.out.printf("QueueConsumer is connecting to Solace messaging at %s...%n", solaceHost);


        // Programmatically create the connection factory using default settings
        ConnectionFactory connectionFactory = new JmsConnectionFactory(solaceUsername, solacePassword, solaceHost);


        // Create connection to the Solace messaging
        Connection connection = connectionFactory.createConnection();


        // Create a non-transacted, client ACK session.
        Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);


        System.out.printf("Connected with username '%s'.%n", solaceUsername);


        // Create the queue programmatically and the corresponding messaging resource
        Queue queue = session.createQueue(QUEUE_NAME);


        // From the session, create a consumer for the destination.
        MessageConsumer messageConsumer = session.createConsumer(queue);


Maybe someone else faced the same issue and has a solution :-)

Greetings,

jfg1306

Tagged:

Answers

  • amackenzie
    amackenzie Member, Employee Posts: 260 Solace Employee
    Options

    If you remove this line:

    // Create the queue programmatically and the corresponding messaging resource
            Queue queue = session.createQueue(QUEUE_NAME);
    

    it will not try and create a queue