Rabbitmq set name for webstomp / stompjs temporary queues - websocket

I just wanted to ask if it is possible to specify the name for the temporary auto-delete queues, which are bound to the destination when I subscribe to a webstomp queue/exchange.
The reason is, that I would like to specify a fine graded JWT permission control, so I would like to give permission f.e. to "stomp-subscriptions-user123-abcde" and therefore I would like to call the temporary queue name not "stomp-subscription-randomstring", but "stomp-subscriptions-user123-randomstring".
Is this possible?
I looked through the available documentation, but couldn't find anything (only the name of the subscription id, but not of the temporary queue name).
Documentation: https://stomp-js.github.io/

Here is the source code for the function that generates a queue name:
https://github.com/rabbitmq/rabbitmq-server/blob/main/deps/rabbitmq_stomp/src/rabbit_stomp_util.erl#L368-L382
Notice that it only auto-generates a name if the x-queue-name header is NOT present. So, it looks like you can specify whatever name you'd like via that header. Here is the documentation for it:
https://www.rabbitmq.com/stomp.html#d.ugqn
NOTE: the RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.

Related

How to create MQRFH2 Header with "Other" (not usr area) folder with JMS

Using Spring's JmsTemplate message.setStringProperty("param", "value") one can set the value in MQRFH2.usr. How can we set values in MQRFH2.other?
I'm not a JMS guy but I do know how to do it with regular MQ/Java API.
You use the MQRFH2 class and use the setFieldValue method:
rfh2.setFieldValue("other", "SomeText", "TEST");
I cannot find where I posted my program MQTest71.java on StackOverflow but you can find a write up on my blog here.
Update 2020/01/14:
This afternoon I played around with MQ/Java programs that created various folders in an MQRFH2 message and then ran MQ/JMS programs to retrieve the messages. MQ/JMS programs simply ignore all folders outside of 'mcd', 'jms' and 'usr'.
Therefore, you need to put the name/value properties in the 'usr' folder if you want MQ/JMS applications to access the information.
According to MQ 9.1.x>Reference>Developing applications reference>MQI applications reference>Properties specified as MQRFH2 elements>Supported MQRFH2 folders there is no other folder.
The folders <jms>, <mcd>, <mqext>, and <usr> are described in The MQRFH2 header and JMS. The <usr> folder is used to transport any JMS application-defined properties that are associated with a message. Groups are not allowed in the <usr> folder.

How to publish message to IBM WebsphereMQ TOPIC using rubywmq gem

I'm trying to use rubywmq gem to publish message to a IBM MQ pub/sub topic. I do not see any direct way of publishing to topic from Ruby code.
Following is the MQ TOPIC, SUB setup MQSC:
DEFINE TOPIC(MY_TOPIC) TOPICSTR('COM/APP')
DEFINE QALIAS(MY_TOPIC_Q) TARGET(MY_TOPIC) TARGTYPE(TOPIC)
DEFINE QLOCAL(APP.RAW.INPUT)
DEFINE QLOCAL(APP.VALIDATOR.INPUT)
DEFINE QLOCAL(APP.ENRICHER.INPUT)
DEFINE QLOCAL(APP.XFORM.INPUT)
DEFINE QLOCAL(APP.LOGGER.INPUT)
DEFINE SUB(SUB.APP.RAW.INPUT) TOPICOBJ(MY_TOPIC) TOPICSTR('MSG/RAW') DEST(APP.RAW.INPUT)
DEFINE SUB(SUB.APP.VALIDATOR.INPUT) TOPICOBJ(MY_TOPIC) TOPICSTR('MSG/XML') DEST(APP.VALIDATOR.INPUT)
DEFINE SUB(SUB.APP.ENRICHER.INPUT) TOPICOBJ(MY_TOPIC) TOPICSTR('MSG/VLD') DEST(APP.ENRICHER.INPUT)
DEFINE SUB(SUB.APP.XFORM.INPUT) TOPICOBJ(MY_TOPIC) TOPICSTR('MSG/ENR') DEST(APP.XFORM.INPUT)
DEFINE SUB(SUB.APP.LOGGER.INPUT) TOPICOBJ(MY_TOPIC) TOPICSTR('#') DEST(APP.LOGGER.INPUT)
I also tried publishing to alias queue for the topic with MQRFH2 header
Ruby Code:
WMQ::QueueManager.connect(:connection_name => conn_name, :channel_name => channel_name, :q_mgr_name=> queue_manager) do |qmgr|
message = WMQ::Message.new
message.data = 'Hello World'
message.headers = [
{
header_type: :rf_header_2,
xml: ['<route>COM/APP/MSG/RAW</route>']
}
]
message.descriptor[:format] = WMQ::MQFMT_STRING
qmgr.put(q_name: 'MY_TOPIC_Q', message: message )
end
And then add a SUB with selector like:
DEFINE SUB(SUB.APP.RAW.INPUT) TOPICOBJ(MY_TOPIC) TOPICSTR('MSG/RAW') DEST(APP.RAW.INPUT) PSPROP(RFH2) SELECTOR('route = ''COM/APP/MSG/RAW''')
Couldn't succeed. Could anyone please point where the problem is or suggest an alternative? Thanks.
Software Version Used:
IBM WMQ Server & Client v7.5
Ruby v2.3.0
rubywmq v2.1.1
Putting a message to an alias over a topic is a method to convert point-to-point apps to pub/sub. Since the API call is PUT and not PUBLISH, there is no mechanism to add a topic string to the prefix supplied by the topic object. The messages are published to the topic string as defined in the topic object and no further. Your SUB.APP.LOGGER.INPUT subscription should be seeing the publications, but not the other ones.
There are several other issues in the posted code. The crafting of an RFH2 header suggests you are relying on docs from perhaps as early as v5.3 or v6. Unfortunately, there is no mention of which version the MQ server is at or which version client libraries are being used by Ruby.
There is also no mention of what you meant by "Couldn't succeed." Does that mean you saw zero publications, even on SUB.APP.LOGGER.INPUT pub appeared to PUT messages OK? Or the PUT returned a bad reason code? Or that you got messages on SUB.APP.LOGGER.INPUT but nowhere else?
For debugging purposes, you can use MQ Explorer, the amqsput sample, or any of the other supplied tools to drop a message onto the alias queue and look for output. The difference between that test and your Ruby testing should help diagnose the issue.
Please do come back and update your question with additional details if you'd like a less speculative response.
The QALIAS must point to a TOPIC object specific to the TOPICSTR you want to publish to. Example:
DEFINE TOPIC(MY_TOPIC_MSG_RAW) TOPICSTR('COM/APP/MSG/RAW')
DEFINE QALIAS(MY_TOPIC_Q) TARGET(MY_TOPIC_MSG_RAW) TARGTYPE(TOPIC)

How do I run/call/kickoff an external program (custom code) whenever certain attributes or objects are added or modified in OpenDJ’s database?

How do I run/call/kickoff an external program (custom code) whenever certain attributes or objects are added or modified in OpenDJ’s database?
Here is my real world need. (Feel free to change my thought direction entirely).
Whenever a new email address gets created or changed in the OpenDJ database I want to initiate some java code that does some email verification/validation (send the “click here” link with a token to prove the user owns the email they just signed up with).
I know, I could use OpenIDM/AM to accomplish this but to take this a step further I need to validate other information and other credentials (custom) which users supply that are not supported by OpenIDM/AM suites.
Initiating/calling custom code upon ADD or MODIFY of specific objects and attributes is what I want and would like to know how to accomplish this. Preferably without having to scrape logs.
Please Help.
Chad
OpenDJ has a plugin interface where you can plug Java calls on Add or Modify. A sample of this kind of plugin is the attribute uniqueness which verifies that some attributes have a unique value in the directory.
The plugin interface javadoc can be found here : http://docs.forgerock.org/en/opendj/2.6.0/javadoc/org/opends/server/api/plugin/DirectoryServerPlugin.html

TFS 2010 Email Alerts

I found this post, which seems to be an exact duplicate, but I can't figure out how to get the answer to work for me so I'm posting again...
TFS2010: Set up an alert that will email a member in the team when a work item is assigned to them
I want anyone (not everyone) using TFS to receive an email when they are assigned an item or when an item assigned to them changes. So, when the alert happens, the person who is currently assigned the item will receive an email.
I know I can set up this on a per-person basis with Alerts Explorer, but I can't figure out how to do this for everyone at once.
I looked at https://tfsalerts.codeplex.com/, but it looks like it's used to send alerts to groups of people...I only want to send the alert to a single relevant person (the equivalent of #Me). If this tool can do that, I'm not sure how to make it do so.
what you want to do is write a TFS Server Plugin. This plugin will fire whenever a certain event occurs. In your case, you will want to catch the WorkItemChangedEvent. In the notification, you will find old and new values of each field. By checking whether the assigned to field changed, you will know whether the WI has been reassigned.
Once you determined that the WI has been reassigned, you can take the New Value, and go to Active Directory (assuming you're using it), and get the email address. Finally, send a message.
For a code example of writing a robust server plugin (that happens to target the WorkItemChangedEvent, check out this blog post: How to Write a Robust TFS Server Plugin

New Bounce Processing Templates in Mailman

When mailman receives a bounceback in a format that it doesn't recognize, it discards the message and sends an "Uncaught bounce notification" to the list administrator.
How would it be possible to define new templates or rules for mailman to process bounces?
For example, the message below is unrecognized by mailman, but is a common bounceback message from a particular domain that many of my list members are using. I would like to be able to have mailman process these automatically.
This message was created automatically by mail delivery software.
A message that you have sent could not be delivered to one or more
recipients. This is a permanent error. The following address failed:
<user#domain.com>: 550 5.1.1 User unknown
You need to write a new bouncer class, eg. Mailman/Bouncers/MyMisbehavingSystem.py. You'll find this in your Mailman installation directory, which might be eg. /usr/lib/mailman/.
Have a look at the other files in Mailman/Bouncers/ for reference. It might be tricky, and I suggest taking a "if we are not absolutely certain, just pass" approach. And enclose your code in a try .. except.
Then, add MyMisbehavingSystem to BOUNCE_PIPELINE in Mailman/Bouncers/BouncerAPI.py.
Finally, please consider contributing the new class to Mailman sources.

Resources