Feed aggregator

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

Tigase XMPP Server Board - 8 hours 46 min ago

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

Tigase XMPP Server Board - 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

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

Tigase XMPP Server Board - Fri, 02/24/2017 - 03:43

Gone through the Development Guide , I want to know the flow , which i could not get through this doc , Flow of the api used in the codes and deployment Steps for tigase master server code

Categories: Tigase Forums

API and development: RE: AMP + Message Archiving

Tigase XMPP Server Board - Thu, 02/23/2017 - 13:12

Thanks of the quick response Andrzej.

We were expecting this response and we are considering modifying the class that filters the messages to fit our use case, by filtering-out messages with amp extension containing status attribute (amp notification)

We're happy to contribute back to the project if you think this something you would like to have, maybe configurable?

Thanks in advance,

Mauricio Giacomello.

Categories: Tigase Forums

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

Tigase XMPP Server Board - Thu, 02/23/2017 - 09:55

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?

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?

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?

Thanks again for your help.

Categories: Tigase Forums

API and development: RE: AMP + Message Archiving

Tigase XMPP Server Board - Thu, 02/23/2017 - 04:31

Message Archive is designed to archive any <message/> with <body/> element and in it. And it does so, it archives incoming message with AMP status notification, why it should not archive this incoming message? Only because it is AMP notifcation?

It is possible to reconfigure processor using sess-man/plugins-conf/message-archive-xep-0136/msg-archive-paths[s] however it is not possible to skip AMP notification message as there is now way to identify this kind of message using only XML path and XMLNS of element at provided path.

Categories: Tigase Forums

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

Tigase XMPP Server Board - Thu, 02/23/2017 - 04:15

All questions you posted are related to fact that you are using XMPPPacketFilterIfc which intercepts every packet and results of processing done by @XMPPProcessor@s.

1) and 2) As I mentioned above, you get every packet, so you it is up to you select packets you are interested in within filter() method. Method canHandle() and annotations (which in fact are used within implementation of canHandle() method are used for filtering only packets delivered to XMPPProcessorIfc.

3) As I mentioned above: "XMPPPacketFilterIfc intercepts every packet and results of processing done by XMPPProcessor@s", so if more than one processor is processing packet then @filter() will be called after each processor finishes it's task (as same packet is processed in same time by multiple processors).

As for your goal:

I'm trying to develop a very basic packet filter to intercept all <message> xmpp stanzas

I think it could be better if you would use XMPPPreprocessorIfc as it is called only once for single processing of a <message/> by SessionManager, but it is done before packet is processed by SM. Also preprocessors need to be very fast.

As for XMPPPacketFilterIfc you can get similar results but you would need to deal with multiple executions of filter() method for same packet being processed, but you also get results of processing packet by SM.

Categories: Tigase Forums

Installation and maintenance: How connect Pidgin to communicate with Tigase XMPP server (unable t...

Tigase XMPP Server Board - Thu, 02/23/2017 - 04:01

Hello everyone,
I am New to Tigase and installed it on my local machine, now I want to setup pidgin to communicate to the Tigase XMPP server. I added an account on Pidgin: Username: Andries Domain: I used Configuration type:
Your XMPP (Jabber) : ABCD.com password: ABC. I'm not quite sure if this is setup correctly on Pidgin. Please can anyone assist me how to setup Pidgin to communicate with Tigase server?. anyone's help will be highly appreciated.

Categories: Tigase Forums

Installation and maintenance: RE: Authentication Required to http://localhost:8080/setup/

Tigase XMPP Server Board - Wed, 02/22/2017 - 22:30

Hi Daniel Wisnewski,

Thank you for very much for your help the default username/password: admin/tigase worked.

Categories: Tigase Forums

API and development: filter development using AnnotatedXMPPProcessor and XMPPPacketFilterIfc

Tigase XMPP Server Board - Wed, 02/22/2017 - 18:18

Hi,
I'm trying to develop a very basic packet filter to intercept all <message> xmpp stanzas. Let's call this filter_tako. For now, it just logs the packet in the filter() method. This is loaded in the init.properties with

--sm-plugins=+message,+message-carbons,+filter_tako,+other_custom_plugin

Here are the questions I have

1.) Despite the @Handles and @Handle annotation from the eg (http://docs.tigase.org/tigase-server/7.1.0/Development_Guide/html_chunk/pluginDev.html#_using_annotation_support) the filter intercepts 'iq', 'presence' and 'message' stanzas. I even tried overriding supElements() method to return "messages", but the filter still intercepts non-messsage stanzas and prints them. What am I missing?

2.) I then tried to overcome this in an overridden canHandle() method with the following check, which didn't work either.

StringUtils.equals(tigase.server.Message.ELEM_NAME, packet.getElemName())

3.) A yet another unexpected thing I encountered was that the filter_tako was invoked multiple times from many different threads, for instance [session-open Queue Worker 6], [in_43-sess-man], [message-carbons Queue Worker 0], [presence-state Queue Worker 0], [in_16-sess-man], [other_custom_plugin Queue Worker 0], [message Queue Worker 0]. I say this because I saw the log statement in the filter_tako pre-pended with these worker names. for instance,

2017-02-22 17:23:03,077 [presence-state Queue Worker 15] DEBUG filter_logger - filter_tako | packet: from=ws2s@{host}/172.31.0.63_5290_172.31.0.1_41443, to=sess-man@{host}, DATA=<presence xmlns="jabber:client" from="{jid}/F3076E56-985B-4610-89B4-9926D42C2C37" type="unavailable"/>, SIZE=145, XMLNS=jabber:client, PRIORITY=PRESENCE, PERMISSION=AUTH, TYPE=unavailable

Shouldn't this be processed only twice as mentioned at http://docs.tigase.org/tigase-server/7.1.0/Development_Guide/html_chunk/packetProcess.html

Here's the code I have..

@Id(TakoFilter.FILTER_ID) @Handles({ @Handle(path = {tigase.server.Message.ELEM_NAME}, xmlns = XMPPProcessorIfc.CLIENT_XMLNS) }) public class FilterTako extends AnnotatedXMPPProcessor implements XMPPPacketFilterIfc { protected static final String FILTER_ID = "filter_tako"; @Override public Authorization canHandle(Packet packet, XMPPResourceConnection conn) { Authorization result = super.canHandle(packet, conn); if (result == Authorization.AUTHORIZED) { if(!StringUtils.equals(tigase.server.Message.ELEM_NAME, packet.getElemName())) { return null; } } return result; } @Override public void filter(Packet packet, XMPPResourceConnection session, NonAuthUserRepository repo, Queue<Packet> results) { logger.debug("{} | packet: {}", FILTER_ID, packet.toString()); } }
Categories: Tigase Forums

API and development: AMP + Message Archiving

Tigase XMPP Server Board - Wed, 02/22/2017 - 16:11

Hi guys, me here again.

Now with a question related to AMP working together with Message Archiving.

So, our current issue is that Message Archiving is storing AMP notification stanzas. We don't know if this is a expected behavior, something configurable or an issue.

Current scenario:
1 - We send a message from A to B, both in the same Tigase Server. Stanza:
<message xmlns="jabber:client" id="gXd79-72" time="1487795805691" type="chat" to="testbot2@example.com" from="testbot1@example.com/Smack"> <body>Quis dolorum nam quia.这यहこน이Эéç</body> <request xmlns="urn:xmpp:receipts"/> <amp xmlns="http://jabber.org/protocol/amp"> <rule value="direct" action="notify" condition="deliver"/> <rule value="stored" action="notify" condition="deliver"/> <rule value="none" action="error" condition="deliver"/> </amp> </message>

2 - User A receives the AMP status notification. Stanza:
<message xmlns="jabber:client" id="gXd79-72" time="1487795805677" type="chat" to="testbot1@example.com/Smack" from="example.com"> <body>Quis dolorum nam quia.这यहこน이Эéç</body> <request xmlns="urn:xmpp:receipts"/> <amp xmlns="http://jabber.org/protocol/amp" to="testbot2@example.com" from="testbot1@example.com/Smack" status="notify"> <rule value="direct" action="notify" condition="deliver"/> </amp> </message>

3 - User B receives me message. (same as #1)

4 - Query message archive Database and we see 3 stanzas (2 messages + AMP response) when we were expecting to see only 2 (inbound and outbound).
5 - Request message archive between A and B (from A) and we see duplicated messages, when expecting to see only 1.

Our init properties look like this:
config-type=--gen-config-def --admins=admin@localhost --virt-hosts=localhost,example.com --debug=server # Configurations for tigase user database --user-db=sqlserver --user-db-uri=jdbc:jtds:sqlserver://<removed_to_post> # Configurations for chat service audit database --audit-db=sqlserver --audit-db-uri=jdbc:jtds:sqlserver://<removed_to_post> # Configurations for AuthRepository # We don't need to configure '--auth-db-uri' because we don't have an authentication database --auth-db=com.<removed_to_post>.authentication.UserAuthRepository # Configurations for Message Archive message-archive/archive-repo-uri=jdbc:jtds:sqlserver://<removed_to_post> sess-man/plugins-conf/message-archive-xep-0136/default-store-method=message sess-man/plugins-conf/message-archive-xep-0136/required-store-method=message # Configurations for dynamic roster sess-man/plugins-conf/dynamic-roster-classes=tigase.xmpp.impl.roster.AnonymousRoster # Install SASL External Mechanism sess-man/plugins-conf/callbackhandler=com.orchestral.chatservice.authentication.JwtSaslCallbackHandler sess-man/plugins-conf/factory=com.orchestral.chatservice.authentication.JwtSaslServerFactory sess-man/plugins-conf/urn\:ietf\:params\:xml\:ns\:xmpp-sasl/mechanism-selector=<removed_to_post> # The plugins which are enabled --sm-plugins=message-archive-xep-0136 # The Components which are enabled --comp-name-1=message-archive --comp-class-1=tigase.archive.MessageArchiveComponent # Configuration for BOSH --bosh-ports=5280,5281 bosh/connections/5281/socket=ssl bosh/connections/5281/type=accept # Certificate Directory --cert-directory-path=certs/ --keystore-name=<removed_to_post> --keystore-password=<removed_to_post> --public-key-alias=<removed_to_post> # Setting to enable AMP between users who are not in rosters --amp-security-level=NONE

Versions: Tigase 7.1, Message Archiving 1.2;

Thanks in advance,

Mauricio Giacomello.

Categories: Tigase Forums

Installation and maintenance: RE: Authentication Required to http://localhost:8080/setup/

Tigase XMPP Server Board - Wed, 02/22/2017 - 10:26

By default the username password combo is admin/tigase, if you setup Tigase using web installer or izpack installer, there will be a configuration screen prompting you for a new username and password.

Categories: Tigase Forums

Installation and maintenance: Authentication Required to http://localhost:8080/setup/

Tigase XMPP Server Board - Wed, 02/22/2017 - 05:22

Hi, I'm trying to setup a Tigase server on my local windows 10 machine. I Run.bat file on the windows computer. I opened the Google chrome to http://localhost:8080/setup/ and it requires the username and password to login. What is the username and password I should use to login or were can I create my own Tigase server login credentials?

Categories: Tigase Forums

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

Tigase XMPP Server Board - Tue, 02/21/2017 - 06:59

Please refer to Tigase Development Guide .

Terms JID and BareJID are defined in the specification - 1.4. Terminology:

  • The terms "localpart", "domainpart", and "resourcepart" are defined in [XMPP‑ADDR].
  • The term "bare JID" refers to an XMPP address of the form <localpart@domainpart> (for an account at a server) or of the form <domainpart> (for a server).
  • The term "full JID" refers to an XMPP address of the form <localpart@domainpart/resourcepart> (for a particular authorized client or device associated with an account) or of the form <domainpart/resourcepart> (for a particular resource or script associated with a server).
Categories: Tigase Forums

Installation and maintenance: RE: Tigase 7.1 & Message Archiving 1.2 published to maven

Tigase XMPP Server Board - Mon, 02/20/2017 - 15:19

Mauricio Giacomello wrote:

We found that maybe we're using the obsolete maven repository.

Yes, you are correct. I've published the blog post http://tigase.net/blog-entry/maven-repositories-url-changes with the information.

Categories: Tigase Forums

Installation and maintenance: RE: How to run a groovy script to change a user's password?

Tigase XMPP Server Board - Mon, 02/20/2017 - 15:04

Staton Eichman wrote:

and view the groovy files in the scripts/admin directory, but I don't know how to run the ChangeUserPassword.groovy script. Any help would be greatly appreciated.

Those are not intended to be run from console. Please read Component Implementation - Lesson 6 - Scripting Support for more information.

What's more, whole development guide should be quite informative to you.

Categories: Tigase Forums

Installation and maintenance: RE: [FIXED] Tigase 7.1.0 LDAP Authentication Problem

Tigase XMPP Server Board - Mon, 02/20/2017 - 15:02

Ronald Chuck wrote:

EDIT6: Fixed by disabling SCRAM-SHA-1, i think this is related to https://projects.tigase.org/issues/4678

This is correct, not all repositories support SCRAM authentication and appropriate check will be implemented in #4814

Categories: Tigase Forums

Installation and maintenance: RE: Wrong Pubsub Database Schema in 7.1.0 Database Install Script

Tigase XMPP Server Board - Mon, 02/20/2017 - 14:54

Thank you for reporting the issue. I've updated the scripts. Those changes will be part of the 7.1.1 release (and part of the nightlies releases)

Categories: Tigase Forums

Installation and maintenance: How to run a groovy script to change a user's password?

Tigase XMPP Server Board - Mon, 02/20/2017 - 03:06

I'm extremely new to server side development/maintenance. I am needing to change a user's password. I can remote into the tigase server, and view the groovy files in the scripts/admin directory, but I don't know how to run the ChangeUserPassword.groovy script. Any help would be greatly appreciated.

Categories: Tigase Forums

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

Tigase XMPP Server Board - Mon, 02/20/2017 - 00:58

I want to know how to use the api to send message in my java code , Whats the basic use of JID and BJID ?

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