where is RabbitMQ internal API reference for plugin development - rabbitmq

I am developing a custom RabbitMQ Plugin, but I cannot find anywhere the internal API reference (in erlang of course) that is solely internal to RabbitMQ. Is this documented somewhere ? Notice this is not the erlang client API that I am looking for, just the internal API reference for use from within RabbitMQ plugins.
As an example: I want to identify the listening port from within the plugling without to look at the config file. I assume the config file is loaded internally in RabbitMQ and is accessible from some internal API such as rabbitmq:getenv("port"), etc.. This is not specific to my problem, I simply need to know where the whole internal API reference is

Related

MQTT backend scaling

I am currently developing a typical IoT service. At the moment multiple devices connect to one MQTT broker (mosquitto) and my java backend also connects to the broker (Paho).
The problem i see is the following:
When i am going to have multiple instances of my java backend every backend will receive and process every message received. That`s a big issue. I just want to deliver a message to only one java backend. Anybody an idea how to deal with this problem?
Btw: Java backends will be added or removed depending on the load.
There are a couple of options
Place a queuing system between your application and the MQTT broker, possibly something like Apache Kafka
HiveMQ and IBM MessageSight brokers support (different implementations) of something called shared subscriptions. This allows messages to be shared out between more than one client. Shared subscriptions is likely to be formally added to the MQTTv5 spec which should mean that it will be added to more broker and have a standard implementation.

What's a typical versioning strategy for RabbitMQ?

I've started working on a new project and we've been asked to build the system as a series of micro services, using RabbitMQ as a communication layer between them.
When developing REST APIs I tend to favour using the accepts HTTP header to control versioning and I see that you can use a header exchange in RabbitMQ to route messages in a similar way. However, as this is purely an internal messaging system, I'm not sure if the added complexity of a header exchange is really worth the while?
What is a typical setup for versioning RabbitMQ messages? It seems to me the options are:
New vhost for each version
Each Exchange has the version in the name (eg. MyExchange-v1, MyExchange-v2, ... etc.)
Queues are versioned
Routing keys are versioned (myroute-2.1.*)
Use a header exchange
Thanks for any input you may have.
I'd go with routing key version system for 2 main reasons:
Consumers will be able to bind (via queues of course) to their compatible versions via multiple bindings. Using semantic version (http://semver.org/) standard would be leveraged here via asterix and hash criteria.
You're not bound to using Rabbitmq as routing key is a standard function of AMQP

how can i expose MULE to external world?

we are using an ESB for any communication between the external world and our application environment, for its obvious uses .
i would like to understand , how can i make any call coming from the external world to go through the mule and vice versa.
what i mean is ,can i use a DNS which reroute all the calls coming form external world to MULE or can directly expose MULE as a service to the
external world so that mule will call an required implementation and sends the response .
i would like to know is there any other way i can handle this .
Thanks
Mule ESB it's production ready. It is very common to find it directly exposed to internet (of course with the proper security measurements any kind of deployment should follow).
Depending on the needs you could even find it behind nginx or apache proxies, behind MOM's and others.

Glassfish - How to broadcast JMS message to all instances in a cluster?

I am using Glassfish 3.1.2, and I set up a cluster with one node and two instances.
I have an message driven bean in my application that subscribes to a topic, which I deployed to the cluster.
When I publish a message to the topic I want both instances to receive the message.
However, in practice I am finding that only one instance receives the message.
I believe I am running into a feature called "shared subscriptions"
http://docs.oracle.com/cd/E18930_01/html/821-2438/gjzpg.html#MQAGgjzpg
The feature (which is enabled by default) says that beans in the cluster with the same client id are shared, and are effectively only one subscription.
It says that by default the client id of an MDB is its name, which means that both my instances are using the same client id.
So other than completely disabling this feature, I would like to know if it is possible to setup an MDB so that each instance subscribes with a different client ID? This seems a bit tricky since both instances are using the same WAR file. I think you can set the client ID in an annotation, but I'm not sure if that can be changed at runtime...
I'm not sure why you would completly disable this feature. In the link you provided, it states clearly that you configure this per ActivationSpec/MDB. So as far as I understand it, it would affect only the MDB you have at hand.
For an MDB, set the ActivationSpec property useSharedSubscriptionInClusteredContainer to false. Do this in exactly
the same way as with other ActivationSpec properties, using
annotations in the MDB itself or in the deployment descriptor
ejb-jar.xml or glassfish-ejb-jar.xml.
But you can of course set the client ID on a connection dynamically during runtime. Please note that you probably would have to handle the JMS connection yourself a bit more than relying on the features managed by the container.
http://docs.oracle.com/javaee/6/api/javax/jms/Connection.html#setClientID(java.lang.String)

How to configure a running Mule service's properties dynamically?

I would like a recommendation/idea on a method to configure properties for a running Mule service dynamically, i.e. I want the service to pick up the new settings without the need to restart Mule. Typically the kind of properties/settings I would like to change are FTP connector user ID, passwords, service URLs etc.
Any idea would be welcome.
Regards, Ola
Use the URI endpoint format do dynamically address endpoints. In simple cases you may be able to use the message properties in a TemplateEndpointRouter
Otherwise You need to write a component that composes the URI and sends the message to the dynamic endpoint using the MuleEventContext or MuleClient.
See here:
http://www.mulesoft.org/documentation/display/MULE2USER/Outbound+Routers#OutboundRouters-TemplateEndpointRouter
http://www.mulesoft.org/documentation/display/MULE2USER/Using+the+Mule+Client#UsingtheMuleClient-PerforminganEventRequestCall
http://www.mulesoft.org/documentation/display/MULE2USER/Mule+Endpoint+URIs
Mule exposes all service configuration via JMX, but I don't see any obvious way to reconfigure the connectors without a restart. They are internally managing pools of connections.
If there is a limited, you can create connectors for each and reconfigure the routes via jmx attributes.
If it is to be fully dynamic you likely need to implement your own service component to manage the ftp connection. Exposing the connection management, configuration, and restarting via JMX should be pretty straight forward.