Tigase XMPP Server Board

API and development: RE: Message Archiving Archives Incoming Message with AMP Twice

Sun, 03/05/2017 - 12:38

I believe it's a different case. That post is seeing 3 entries in the message-archiving database. Two of them is the the message itself (outgoing and incoming) and the third is the AMP response from the server. In our case, we have 3 entries as well and two of them is the same (the outgoing and incoming) but our third entry is different. Our third entry is actually the incoming message that's been archived twice. It's the exact same stanza except with a different timestamp.

An example of the three entries:
11410 26 18 2017-03-03 03:12:33.747 1 chat Sunt saepe et numquam tenetur modi ut illum.这यहこน이Эéç <message id="0K4W0-245" xmlns="jabber:client" to="testbot8@example.com" type="chat" from="testbot7@example.com/Smack" time="1488510753746"><body>Sunt saepe et numquam tenetur modi ut illum.这यहこน이Эéç</body><amp xmlns="http://jabber.org/protocol/amp"><rule action="notify" condition="deliver" value="direct"/><rule action="notify" condition="deliver" value="stored"/><rule action="error" condition="deliver" value="none"/></amp></message> 4/fvliS/Fh6BnrXLMGwjhkP/cpE/f0OVdIgQme1/yM8= Smack
11409 26 18 2017-03-03 03:12:33.743 1 chat Sunt saepe et numquam tenetur modi ut illum.这यहこน이Эéç <message id="0K4W0-245" xmlns="jabber:client" to="testbot8@example.com" type="chat" from="testbot7@example.com/Smack" time="1488510753744"><body>Sunt saepe et numquam tenetur modi ut illum.这यहこน이Эéç</body><amp xmlns="http://jabber.org/protocol/amp"><rule action="notify" condition="deliver" value="direct"/><rule action="notify" condition="deliver" value="stored"/><rule action="error" condition="deliver" value="none"/></amp></message> 4/fvliS/Fh6BnrXLMGwjhkP/cpE/f0OVdIgQme1/yM8= Smack
11408 18 26 2017-03-03 03:12:33.743 0 chat Sunt saepe et numquam tenetur modi ut illum.这यहこน이Эéç <message id="0K4W0-245" xmlns="jabber:client" to="testbot8@example.com" type="chat" from="testbot7@example.com/Smack" time="1488510753742"><body>Sunt saepe et numquam tenetur modi ut illum.这यहこน이Эéç</body><amp xmlns="http://jabber.org/protocol/amp"><rule action="notify" condition="deliver" value="direct"/><rule action="notify" condition="deliver" value="stored"/><rule action="error" condition="deliver" value="none"/></amp></message> EwM+Io5oklbC9WD0MglR02uiae8U3N+0zrPmKoTJyKo=

As you can see, the first entry (the bottom as this was sorted in desc order) is the outoging message. The second and third entry is the exact same except the timestamp.

Categories: Tigase Forums

API and development: RE: Send push notification with every message

Fri, 03/03/2017 - 06:41

Staton Eichman wrote:

Is it necessary to use a component? Can it all be done simply by using a plugin?

It's possible to use a plugin, but dedicated component will definitely be a better solution.

Actually, our server already sends push notifications to offline users (but it is only using Apple Push Notifications). Unfortunately I never developed anything for the server before, and the previous developer is no longer at our company so I can't ask him for help.

We offer consulting services - please contact us directly http://tigase.net/contact :-)

Anyways, I ask if it is necessary because I used PSI's Service Discovery option, and the only components that are running on our server are MUC and PubSub, yet I am still able to receive push notifications on my iPhone. So, would this mean that the previous developer implemented push notifications by only using a plugin?

It's really difficult to comment on your installation with such scarce detail. It could be a component+plugin, it can be a plugin-only solution.

Categories: Tigase Forums

API and development: RE: Message Archiving Archives Incoming Message with AMP Twice

Fri, 03/03/2017 - 01:27

I think you are trying to do the same thing which was already discussed in AMP + Message Archiving

Categories: Tigase Forums

API and development: RE: Send push notification with every message

Fri, 03/03/2017 - 00:45

Is it necessary to use a component? Can it all be done simply by using a plugin?

Actually, our server already sends push notifications to offline users (but it is only using Apple Push Notifications). Unfortunately I never developed anything for the server before, and the previous developer is no longer at our company so I can't ask him for help.

Anyways, I ask if it is necessary because I used PSI's Service Discovery option, and the only components that are running on our server are MUC and PubSub, yet I am still able to receive push notifications on my iPhone. So, would this mean that the previous developer implemented push notifications by only using a plugin?

Categories: Tigase Forums

API and development: Message Archiving Archives Incoming Message with AMP Twice

Thu, 03/02/2017 - 19:20

Hey there,
Currently, we're having an issue with Message Archiving and AMP. The issue is that when we send a message with AMP, the incoming message is archived twice. We believe this is due to the AMP plugin since this only happens when we have the AMP path in the message. Also, we tried disabling the AMP plugin in the init.properties and it only archived once for each direction (which is the behaviour we want). Do you have any ideas on how to correctly modify this message archiving behaviour to what we want?

Thanks.

Categories: Tigase Forums

API and development: RE: Send push notification with every message

Thu, 03/02/2017 - 14:23
Most likely you would want to develop:
  • a component which would handle communication with the Azure Notification Hubs;
  • a plugin which would forward relevant stanzas/messages do your component.

Please refer to Tigase Development Guide for the details how to go about developing those.

Categories: Tigase Forums

API and development: RE: API to send messages to users

Thu, 03/02/2017 - 13:46

What do you mean "send messages to logged-in users"? Can you explain what you want to achieve?

Categories: Tigase Forums

API and development: RE: API To send messages from one user to other

Thu, 03/02/2017 - 13:42

origin/master contains latest development code and not everything may be documented yet. Basic processing flow is the same. Biggest change comes with Tigase Kernel but you can still use the previous way do develop component (which is not that different, biggest difference comes to initialisation and configuration of Component)

Categories: Tigase Forums

Installation and maintenance: RE: How to connect Pidgin to communicate with Tigase XMPP server (u...

Thu, 03/02/2017 - 13:25

I would recommend revising Piding documentation for the details. We do have a Psi client setup-guide ( Configuration Instructions for Psi).

Particular details depend on your Tigase Server installation (data you've provided during setup, especially VHost name)

Categories: Tigase Forums

API and development: RE: Strange error in tigase-console.log

Thu, 03/02/2017 - 08:49

David Leder wrote:

I'm still running 5.2 on that system.

Ok, that's pretty old. You mention something about custom auth plugin. Is this your custom code? Race condition is a possibility but given details below, unlikely cause of the problem. See below for more comments.

I've got about 2000 User logins/sec (BOSH with reconnect every 30sec) which probably also generates the highest load on everything.

Ok, this might actually cause lots of problems, performance and resource related. With approx 50k connections per node, you have occupied 50k file descriptors/network connections. However, 2,000 new connections/disconnections per second means that you also have additional, at least 200k file descriptors/network connections in use. This is because by default, a closed connection does not return resources back to the system right away. The closed connection stays in WAIT state for... that depends on the OS configuration. Usually something between 60 - 300 seconds.
So you may have a huge number of connections in WAIT state on your server which may even cause you running out of available file descriptors or network connections. Depending on how exactly you have the system deployed, if you use Proxy or a firewall this may cause out of resources problem on these devices too.
Even if there are routers between your clients and the server, these may cause sudden connections drop or connection unavailability with such a high connect/disconnect rate.

Therefore, it is definitely possible to find out what is causing the problem but in your case it may require a thorough investigation.

The tigase monitoring plugin always shows 0 for MSG/sec, which is probably not right (I'm using it to synchronize end-user measurements on multiple devices for a single customer). However I cannot state any reliable MSG/sec figure.

This maybe server/monitor version mismatch. I suggest you to try to get statistics from the Tigase server and get the metrics directly from there.

Categories: Tigase Forums

API and development: RE: Strange error in tigase-console.log

Thu, 03/02/2017 - 02:04

I'm still running 5.2 on that system.
I've got about 2000 User logins/sec (BOSH with reconnect every 30sec) which probably also generates the highest load on everything. The external auth DB should not be a problem, it runs "mysql Ver 14.14 Distrib 5.5.51-38.1, for Linux (x86_64) using readline 5.1" and is a direct slave replication of the main DB (there is no write activity on that node). The tigase user DB is running mysqld Ver 5.5.30-30.2 for Linux on x86_64 (Percona Server (GPL), Release rel30.2, Revision 509)".
The tigase monitoring plugin always shows 0 for MSG/sec, which is probably not right (I'm using it to synchronize end-user measurements on multiple devices for a single customer). However I cannot state any reliable MSG/sec figure.

Categories: Tigase Forums

Installation and maintenance: RE: Cluster mode in 7.0.4

Wed, 03/01/2017 - 16:15

It certainly unusual behaviour. It is hard to tell what is going on without deeper investigation. I would suspect some kind of network configuration issue, like, for example, incorrect hostname settings on on or both cluster nodes or maybe DNS misconfiguration.

Categories: Tigase Forums

API and development: RE: Strange error in tigase-console.log

Wed, 03/01/2017 - 16:12

What version of the Tigase server do you run? What kind of load, in terms of messages per second, or how many user logins per second do you have? Do you run Tigase with ACS in a cluster mode?

50k connections / node might be a lot or might be not that much, it depends on what kind of machine you use as a server. Is it real HW or a VM?

The kind of errors do you see might be caused by timeouts. If you have lots of traffic and many user logins per second you may experience authentication timeouts which may result in errors you see. What kind of DB do you use? Are you sure the DB can handle the load?

Categories: Tigase Forums

Installation and maintenance: Cluster mode in 7.0.4

Wed, 03/01/2017 - 08:36

Hi All.

I seem to have a weird issue. I have setup a cluster with two nodes and ACS. Using mysql as database.

The machines connect to each other on port 5277, but they don't send data at all between each other. I tried a tcpdump and there was no data between them. I go to the cluster_nodes in the DB there are both there. And it seems it using the db to notify each other about there presence.

But If I do a broadcast message through the API, the message are only received by the clients on the node that I called with the rest api, but the other node doesn't received it. But if one of my users do something in the client like log off and log on, or sends a message the message suddenly appears. If I look in the msg_history table, they look like offline messages.

I have another cluster with the exact same setup, and it is working perfectly. They are using the same init.properties except using another db.

Have you guys seen this?

Categories: Tigase Forums

API and development: Strange error in tigase-console.log

Wed, 03/01/2017 - 02:46

Hi everyone

I'm running a 4-backend cluster with ~50k simultaneous connections each node. Occasionally I see the following entry in the tigase-console.log:

stream:error termination

Unfortunately I have no idea what could cause this. I do also have some NotAuthorizedException exceptions and I think they are coming from some race-condition while authorizing through the custom auth plugin.

Can someone tell me what's the origin of the "stream: error termination" and how I might debug it?

Best Regards
Dave

Categories: Tigase Forums

API and development: RE: filter development using AnnotatedXMPPProcessor and XMPPPacketFilterIfc

Tue, 02/28/2017 - 07:50

I guess what I'm asking is, like the pre-processor that works in the session manager thread (not a thread pool), does a filter created using PacketFilterIfc work in the component's thread that it is loaded into?

Yes, they work in very similar way.

Does it need to be fast and possibly not do blocking http calls?

As it works in component thread pool it needs to be fast as well.

Categories: Tigase Forums

API and development: RE: filter development using AnnotatedXMPPProcessor and XMPPPacketFilterIfc

Mon, 02/27/2017 - 14:55

Thank you very much! I'll look into how to make that happen with your suggestion.

I have one more, possibly the last :), question here. Other than the fact that XMPPPacketFilterIfc works explicitly in the session manager, what are the differences between creating a filter using XMPPPacketFilterIfc v/s using PacketFilterIfc? I guess what I'm asking is, like the pre-processor that works in the session manager thread (not a thread pool), does a filter created using PacketFilterIfc work in the component's thread that it is loaded into? Does it need to be fast and possibly not do blocking http calls?

Thanks for clarifying so many things!

Categories: Tigase Forums

API and development: Send push notification with every message

Mon, 02/27/2017 - 02:21

I am wanting to send a push notification to Azure Notification Hubs whenever a new message is received by the server. I've never done any development on tigase, so I'm completely new to this. What would be the best way to go about doing this? Would using this Java REST wrapper be what I need? : https://github.com/Azure/azure-notificationhubs-java-backend

Thanks

Categories: Tigase Forums

API and development: RE: filter development using AnnotatedXMPPProcessor and XMPPPacketFilterIfc

Sat, 02/25/2017 - 10:31

Gagan Malik wrote:

Thank you Andrzej! That explains a lot. I have these follow up questions now..

1.) What is then a real world use-case of XMPPPacketFilterIfc? I've seen it implemented in a few classes in the tigase.xmpp.impl but that is almost always along with XMPPProcessorIfc and XMPPPreprocessorIfc except in ErrorCounter. Wouldn't ErrorCounter@ErrorCounter@ be susceptible to counting the same error packet multiple times?

No, as it processes results packets (packets sent by SM).

2.) The end goal is to develop a spam-block functionality. Now, pre-processor does seem the right place after your explanation, but there will need to be at least one synchronous http request made to a 'spam-check service' to determine if the message should be let through or be blocked. Do you still think pre-processor is the right place?

pre-processor is a right place but due to slow processing (synchronous call to http) it will not work as it should and may cause additional delays during processing of messages.

3.) This is related to question #2. I referred to an earlier discussion on the forums here https://projects.tigase.org/boards/4/topics/3422
Like you have pointed out that pre-processor needs to be very fast, Artur mentions

You can do the same thing in the "filer" as you do in the "preprocessor". You can amend the message or block it completely form delivering. The main difference is that you do it later in the processing chain. This may mean like a bad idea as if you block something you want to do it as quickly as possible. However, the main advantage is that "filter" is being processed in the plugin thread pool. Therefore it does not impact main processing in SessionManager, therefore it overall impact on the server performance is much lower.

What is the best approach, if any, to de-duplicate the multiple executions of filter(), if that is the correct place for such functionality?

I think it would be best to go with totally different approach and create preprocessor which forwards <message/> to different component which would be handling message filtering based on remote calls to HTTP server and then sending packets back to SM.

This solution will perform quite well in terms of performance but it would be tricky to implement it.

Thanks again for your help.

Categories: Tigase Forums

API and development: API to send messages to users

Fri, 02/24/2017 - 06:39

Hi,

We have gone through the Development Guide. Which API do we use to send XMPP messages to logged in users? We have a similar question to Kirti.

thanks

Categories: Tigase Forums

Pages

Get in touch

We provide software products, consulting and custom development services

Tigase, Inc.
100 Pine Street, Suite 1250
San Francisco, CA 94111, USA
Phone: (415) 315 9771

Follow us on:

Twitter

Back to Top