looking for current example of MDB consuming messages from remote queue in Wildfly 10 - jboss

I have a Wildfly 10 instance which defines a queue, publishes to that queue as well as receives from that queue via an MDB.
That has been have accomplished.
Now I want to add a second Wildfly 10 instance, running on another machine, which will also receive messages from that same (remote) queue defined in the first instance.
I've spent 2 days looking for a current example of how to do this.
There are tons of questions, and some outdated answers.
It seems like the one of the most trivial things to expect from a Q implementation, yet i cannot find any example.
Would someone please refer me to a good and current example (Wildlfy 10) of what needs to be done as far as annotation of the MDB, configuration of the standalone-full.xml, and and security requirements?

I looked into a similar scenario and I had as well trouble to find good documentation.
There are several ways to connect JMS-Queues together:
JMS core bridges
JMS bridges
Connections to a remote server (using a remote connector or properties directly in your MDB).
JMS-Clustering
… ?
I created a demo project at Github which uses "JMS-Bridges" to forward messages to another server. The project also uses remote connections to listen to messages of a remote server. The readme explains step by step how I would configure "Wildfly 10" servers that they use the same destination for JMS messages.
The best source of information concerning this topic seems to be the Messaging documentation of the Red Hat JBoss Enterprise Application Platform 7.0 which is as well valid for Wildfly 10.

Related

Mirth Connect send old messages when changing server

I have a Mirth application installed in Ubuntu server. I try to move the application from one server to another server (DRC server). When I moved the application, somehow the Mirth keep sending old messages to the channel.
The source of sending channel is using Database Reader and connecter type for destinations is using TCP Sender. Im using Mirth Connect version 3.5.2
Does anyone know why this is happening. Is there any log files that I need to clear when moving the application from one server to another?
This can happen for several reasons. Application logic, queued messages. My guess is you moved appdata directory along with installation, if so you must be seeing similar stats from where you moved.
Mirth stores all channels information, transactions etc. by default under appdata folder. If you are using default settings it'll use derby db. You can connect to that DB with any DB client support JDBC. i.e.
SQuirelL or DB Visualizer and that can give you an idea what's happening.
I recommend you to make a clear setup. Then, you can export/import your channels into your new environment. You can also consider using any other DB, oracle/sqlserver/mysql.. for Mirth. Current version is 3.9.10 and it has better support for DBs other than derby.
As mentioned in the comments your application logic also matters.

Load properties into application based on Weblogic managed server

I have this requirement - I have several managed servers running on my Weblogic (version 12.x). There are multiple machines as well.
Machine 1: Managed server 1, 2
Machine 2: Managed server 3, 4
I have a spring-boot based application (war) that is deployed across all managed servers. It has both an MDB (to read messages from JMS queue), and a SOAP Webservice.
The queue that it is reading messages from is however targeted/deployed only on a few managed servers - 1 and 3.
Now, I don't want my application to fail or start complaining when it doesn't find the queue on managed servers 2 and 4. Hence, I wish to load my MDB based on a property/configuration specific to managed server.
Is there any way to achieve this?
You could add a custom System property to the server start parameters of server 2 and 4 in the admin console, ie: "-DignoreMDB=1" and read that using a System.getProperty("ignoreMDB") != null call. Note that you need to restart the nodemanager first and your managed servers second to get modification to the server start parameters active.

How does an out-of-process semantic logging service receive events?

The reason I'm asking is I would like to use the out-of-proc mode, but I cannot install a service on each user's workstation, only on a central server. Is the communication between event source and listener service an ETW thing, or is there some kind of RPC I could use?
Yes, the out-of-process mode works by using ETW. All ETW events are system wide so the service just has to listen to ETW events.
ETW only works locally and does not offer a remote solution you could use. Your options are to install a service on each workstation, listen to ETW events (here or here) and forward them to your server with a RPC solution you build yourself. Using MSMQ comes to mind. Or have your application forward the events to your server directly so you don't need the service. Either way, you will have to build it yourself.
To add to Lars' answer, you could also log to SQL. There is a SQL sink you can use but like everything else, to get the most customized fit, you would build your own (or inherit from another class to give you a good starting point). Be careful though. Not all sinks are created the same. They all have their pros and cons. For example, with SQL and Azure sinks, you have to worry about high latency. The XML formatter doesn't write the root starting and ending node so it's not well-formed xml. Whatever reads that file would have to provide them. Good luck!

Connect to JMX using PowerShell

I am not a developer so please keep that in mind when reading the following message:
I need to be able to use Windows PowerShell to connect to a JMX RMI agent on a host, is this even possible ?
The example string from the java client I have been given is as below:
JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:7979/jmxrmi");
The reason for this is that I am doing other work in my PowerShell script and would like to keep it all in one place.
Thanks !
This is an unusual mix of two technologies, but it is possible.
On the off-chance that you are attempting to connect to a JBoss server, the quickest way may be for you to call twiddle, a command tool that will dispatch JMX requests to the target JBoss server and return the results to standard out.
Another way is to implement the Jolokia agent on the target servers. This will allow you to issue JMX requests using REST. Responses will also be returned in REST format which you can process in PowerShell using one of these solutions.
Thirdly, you can also deploy the JMX-WS service on your target servers which will allow you to communicate with the JMX server using web-services. This document provides some VBScript examples of this.
None of the above actually uses the JMXServiceURL syntax you outlined, and I cannot think of a way you could actually cleanly integrate this RMI based protocol into PowerShell, but hopefully one of the above will work for you.
========== UPDATE ==========
There may be a way to use the RMI implementation. Take a look at IKVM. It is a Java Byte Code to .NET compiler. I have successfully compiled JMX/RMI java code into a .Net assembly and used it from C#. I think PowerShell will do the same thing.

Where to configure the org.jboss.ejb3.mdb.MdbDelegateWrapper

I need to reduce the pool size of an MDB to 5 because it connect to an external resource that is limited in terms of connections. If I have 15 messages in my JMS queue, then only 5 msg are process successfully and the other 10 are waist because of connection error happening in the MDB code.
I show this setup in the Jboss JMX-console:
I'm using Jboss 4.2.3. I need to know where I can edit this MaxPoolSize config. I searched everywhere but haven't found it.
Thanks
I guess adding the limit in 'instance-pool' in Jboss.xml should do it.
Check this blog article and Jboss docs to see how to use 'instance-pool' and 'strictMaximumSize'