How To Setup Qpid with Queues using qpid-config.json - java

Is it possible to define what queues and topics should exist in qpid using qpid-config.json. I am using qpid 7.1.0.
How would I do this in a config file?

Qpid Broker-J has two levels of configuration, broker-wide configurations and virtual-host specific configuration. Each virtual host has its own set of queues and topics (or - more properly - exchanges), so the queue and topic definitions are in the virtual host config.
If you are just using the default configuration you get with Broker-J then it will create a virtualhost named "default" with the configuration stored as JSON in the file system (e.g. in work/default/config.json ).
Probably the best way to see how the queue and exchange configuration is stored in that file is to first create queues/exchanges through the Management UI, and then look to see what the config looks like. (Note that you shouldn't manually edit the config while Qpid is running... as it will likely overwrite it, however you can update the config while Qpid is stopped and it will pick up the changes).

Related

Apache camel don´t use all the dynamic queues created

I'm using apache camel for consuming an IBM Mq, I use jms for that, everything is ok that works fine, but in the performance testing the api create a lot of dynamic queues but just use once, I've used a lot of properties for solve this problem but I didn't get it yet. my api use a pattern InOut so the responses are in queue in a dynamic queue, when exist a lot of them, for example my api create 50 dynamic queues, but just use 3 of them.
Here are the properties I used to solve it, but didn´t work for me:
-maxConcurrentConsumers
-conccurrentConsumers
-threads
I found a solution for this and is this.
this is my consume to mq
.setHeader("CamelJmsDestinationName",
constant("queue:///"+queue+"?targetClient=1"))
.to("jms://queue:" + queue
+"?exchangePattern=InOut"
+"&replyToType=Temporary"
+"&requestTimeout=10s"
+"&useMessageIDAsCorrelationID=true"
+"&replyToConcurrentConsumers=40"
+"&replyToMaxConcurrentConsumers=90"
+"&cacheLevelName=CACHE_CONSUMER")
.id("idJms")
and this is the properties to connect the mq
ibm.mq.queueManager=${MQ_QUEUE_MANAGER}
ibm.mq.channel=${MQ_CHANNEL}
ibm.mq.connName=${MQ_HOST_NAME}
ibm.mq.user=${MQ_USER_NAME}
ibm.mq.additionalProperties.WMQ_SHARE_CONV_ALLOWED_YES=${MQ_SHARECNV}
ibm.mq.defaultReconnect=${MQ_RECONNECT}
# Config SSL
ibm.mq.ssl-f-i-p-s-required=false
ibm.mq.user-authentication-m-q-c-s-p=${MQ_AUTHENTICATION_MQCSP:false}
ibm.mq.tempModel=MQMODEL
the issue was in the MQ Model, the MQModel has to be shared if you are using the pattern inOut, this is because the concurrent create dynamic queues using the mqModel

log output from qpid library running in weblogic

I am looking for a way to get more detail, like debug or verbose level logging, of a JMS message send over amqps to AzureServiceBus.
I am using qpid client 0.60.1 and I have no access to the calling code. I am working with a web application running in Weblogic. The application provides a servlet that has generic JMS functions, and I can use configuration that maps those to a specific providers' JMS connection factory libraries. To make qpid available to use, I add the qpid client jars to the CLASSPATH for when I start weblogic, and I provide a jndi.properties file that currently contains only two entries:
con
connectionfactory.ServiceBusConnectionFactory=amqps://?jms.username=&jms.password=
queue.inbound-general-q-QueueLookup=
Currently, this is the only message that I see in the weblogic log:
Connection ID:6147a0e7-1870-4a1a-8dd5-bd7102fc1aa4:106 connected to server: amqps://
I have been told that we don't have enough information to open a case with Microsoft.
I am looking for a way to get more detail, like debug or verbose level logging, of a message send. Ideally, want to see as much as possible: headers, properties, payload, etc.
The things I have access to change:
Weblogic environment, including classpath and any other java runtime flags
The jnd.properties file
I am reviewed the qpid.apache.org documentation on logging, but it has not been helpful to me as it is too vague.
The main application running in weblogic has these parameters in its runtime:
-Djava.util.logging.config.file=properties/logging.properties
-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger
I have tried adding some things to logging.properties, but it has never changed the output of the resulting log file to include anything from amqp.

Is it possible to prevent a Spring Boot app from attempting to connect to IBM MQ?

I have a spring boot application that is connecting to an IBM MessageQueue service using the IBM Spring Boot starter:
com.ibm.mq:mq-jms-spring-boot-starter:2.1.2
I have a component class listening to the queues and it has the following annotation to enable/disable connecting to the queue:
#ConditionalOnProperty(name = "queue.enabled", havingValue = "true")
I also have the following property in my application.properties:
queue.enabled=false
This annotation worked for disabling the queue connections when I was connecting to ActiveMQ, but upon changing the codebase to connect to IBM MQ it seems that the connection is unaffected by the ConditionalOnProperty and always tries to connect.
Is there a way to enable/disable connecting to the IBM MQ service upon server startup?
The MQAutoConfiguration class that exists in the mq-jms-spring-boot-starter dependency is what is causing the attempted queue connection.
You have two options to fix this issue, one requires you to set a specific property, and the other allows you to define the property you want used to enable or disable the queue connection.
Option 1
Set the value spring.jta.enabled = false in your application.properties file.
(This may not be a preferred option if you're using transactions in your application.)
Looking at the MQAutoConfiguration class, you can see it is conditional on the property spring.jta.enabled. Setting that property to false in your application.properties file will prevent the MQAutoConfiguration class from being registered, which means no MQ beans get registered, and therefore no attempts will be made to connect to a queue.
Option 2 (if you don't want to disable JTA)
Create the package com.ibm.mq.spring.boot and create a copy of the MQAutoConfiguration class there. Modify the #ConditionalOnProperty annotation to the property of your choosing.
Just exclude configuration in your application.properties.
spring.autoconfigure.exclude=com.ibm.mq.spring.boot.MQAutoConfiguration

Is there possibility to Spring Config Server gets config from itself?

Is there possibility or workaround to tell Spring Config Server to get config from itself? I have some common configs for all Spring Boot apps depending on profile and I want config server has possibility to access them without copy-paste.
From the docs:
An optional property that can be useful in this case is spring.cloud.config.server.bootstrap which is a flag to indicate that the server should configure itself from its own remote repository.
So setting spring.cloud.config.server.bootstrap=true.

How to setup JMS bridge to ActiveMQ on Weblogic 11g

I'm novice guy in JCA and JMS parts of Java EE stack, and now I'm struggling with JMS bridge configuration between two JMS providers (ActiveMQ 5.9.1 -> Weblogic 11g 10.3.5), and I need some help to understand all the moving parts and required configuration elements.
What I've done already:
JMS server configured on Weblogic 11g node
Configured Foreign Server - AMQ connection factory, and source queue objects bound to the local JNDI (OK: conn. factory and queue objects visible in server jndi tree)
Create JMS Bridge with default props (OK - I think)
Created the Bridge Destination for target destination (Weblogic) with default configuration - where possible (OK: Resource Adapter deployed)
Created the Bridge Destination for source destination (AMQ) - JNDI properties, default props where possible (FAIL - Cannot connect to the source destination)
And there is the question:
By default there are two resource adapters (XA, non-XA), do I need install the AMQ specific resource adapter?
I've assumed that yes, so I've downloaded rar file on Weblogic machine, then tried to install with Weblogic Console (Deployment -> Install), but.. another trouble - no way to achive Running state in Deployments view. I've read that all jars from rar need to be placed in Weblogic CLASSPATH, so I've copied them to Weblogic lib directory. But, with no success so far.
So, what I did wrong, where is the gap or an error in this configuration?
I have studied the Oracle documentation, but I feel still didn't get the complete understanding of the bridge config :((
Any explanatory replies very appreciated!!!
Ok, problem solved. I've used wrong JNDI names of connection factory and queue - local names defined in Foreign Server configuration instead of names on remove JMS server.
Actually, no additional configuration like Foreign Server, or Resource Adapter is needed here.

Categories

Resources