I am using XMPP Pubsub (XEP-0060). My application has the following requirements:
Users can create pubsub nodes: This is working fine.
Users can subscribe to already created nodes and automatically become publishers without owner intervention. I am in a situation where I need everybody on the node to be both a publisher and subscriber.
The problem I have is that after I subscribe a new user to the PubSub node, they have a "none" affiliation by default. There is no way to change the affiliation from my client application as the only the owner can change affiliations.
Am I missing a setting in the XEP-0060 that can help achieve this behavior?
If you control the client that create the node, you can consider looking into the publish_model option of the PubSub node.
The default publish_model is publishers, but there are other options available such as subscribers and open. Setting the publish_model option of your PubSub node to subscribers should help you achieve what you need.
Depending on the actual XMPP server you are using, the feature may or may not be available. It should work with ejabberd latest version configured to use node type hometree.
Related
I'm using ActiveMQ Artemis 2.18.0 and some Spring Boot clients that communicate with each other via topics. The Spring Boot clients use JMS for all MQTT operations.
I'd like to know if it is possible for a producer with one or more subscribers to find out whether a certain subscriber is actively listening or not. For example, there are 3 clients - SB1, SB2, and SB3. SB1 publishes to test/topic, and SB2 and SB3 are subscribed to test/topic. If SB2 shuts down for any reason would it be possible for SB1 to become aware of this?
I understand that queues would be the way to go for this, but my project is much better suited to the use of topics, and it is set up this way already and works fine. There's just one operation where it must be determined whether the listener is active or not in order to update the listener's online status, a crucial parameter. Right now, clients and the server continually poll a database so that the online status is periodically updated, I want to avoid doing this and use something that Artemis may provide instead.
Apache ActiveMQ Artemis emits notifications to inform listeners of potentially interesting events as consumer created or closed, see Management Notifications at http://activemq.apache.org/components/artemis/documentation/latest/management.html.
A listener of the management notification address would receive a message for each consumer created or closed, see the Management Notification Example at http://activemq.apache.org/components/artemis/documentation/latest/examples.html#management-notification
Part of the point to pub/sub based messaging is to decouple the information producer (publisher) from the consumer (subscriber). As a rule a published REALLY shouldn't care if there even are any subscribers.
If you want to know the status of the subscriber then it's up to the subscriber to update this, not the publisher. Things like the Last Will & Testament feature allow the subscriber to update it's status in the event of a failure to explicitly do it when going offline.
I am doing some investigation into how we could push realtime updates into a dashboard.
One possibility arose to use the Kafka REST Proxy to expose the underlying Kafka Topics directly via the REST Proxy to an Angular Application for users to subscribe to which could work for our use case.
Given the way that Kafka and the HTTP Proxy works, it seems we would need to create a new "Consumer Group" for each new Session but unsure if this is a good idea now or not.
Does this use case go against the intended use case of the Kafak REST Proxy or is this fine? Should we be concerned about creating so many Consumer Groups?
Albeit, we are talking about 100's of users and not 100,000s so the actual number of concurrent user sessions here is quite low.
We're running Asterisk version 1.8.4.2 and I'm looking to create a server application that will allow several client programs to check on the "presence" of specific extensions, among other things. I understand that the AMI will allow me to poll this information, however I was hoping there might be a way to give the server an extension and subscribe it to the extensions in question to avoid having to poll the AMI constantly.
It seems like I might have to implement the SIP protocol into my server if BLF were the route I wanted to take. Is there a better and simpler solution that I've managed to overlook in my research?
You could implement these approaches:
AMI event hook and digging in incoming events
Make your application subscribing on notifies on extension status changes via SIP notifies
Make your asterisk publishing extensions status with XMPP
I was looking at using Faye for a project I've been working on since socket.io has been causing me trouble. I set up and played with some of the examples on their github and found that clients can publish straight to whatever room they are connected to. This is different behavior than what I would like. I want to limit client behavior in certain rooms to where they cannot publish at all but the server will periodically send data to the room updating them all on new information (Basically a strict subscribe behavior on certain rooms). Is this type of behavior possible with Faye or am I barking up the wrong tree?
With CometD, you can fine tune the behaviour you want.
You have available a SecurityPolicy that allow you to control coarsely the publish authorizations, and channel Authorizers that allow you to control finely the publish authorizations (among others).
Have a read at the SecurityPolicy documentation, and at the Authorizers documentation.
The Bayeux protocol has been designed by the CometD project where you can find the latest specification.
Have also a look at the CometD tutorials, if you want to get started with CometD.
I'm using XMPP to drive a notification system. Basically I will have a set of services, some of which will broadcast to all users and some which are directed to a specific client (full JID).
For a service that broadcasts to all users a PubSub node seems the obvious choice but for a service that targets its messages to a specific client, I'm unsure of the best mechanism to use.
Do I represent these services as other client users and create bespoke implementations for them? The problem I see with this is how will they be discovered? Do I group them into a chat room and discover that. It feels like a bit of a hack. I could also define my own bespoke type of service, but then I have to define my own XML tags and maintain that.
I know there are plenty of standard extensions to XMPP but I cant see anything useful in this case.
Even in the pubsub case, the publisher (i.e. your service) is still a "user", so this configuration will be pretty standard. We simply create service accounts to represent those "users".
I am unsure of what you mean by "how will they be discovered". Why do the services need to be discovered? Your scenario only gives the use case of services sending messages to the users. Assuming the service already knows who the message is to be sent to, then you don't need any other information to send a message.