Project

General

Profile

How to use PubSub if I want to publish message?

cheng cheng
Added about 3 years ago

I have install tigase pubsub,how to use it?

thinks very much!

thinks very much!

thinks very much!


Replies (9)

(1)

Added by Wojciech Kapcia TigaseTeam about 3 years ago

Tigase follows specification therefore method described in PubSub XEP, section Publish an Item to a Node describes all the steps in detail.

(1)

Added by cheng cheng about 3 years ago

I have read it,but I also don't known how to call and call which method.

And PubSubComponentTest.java also don't have a complete examples。

Can you give me a complete examples of sending a message ,how to send messages to someone ro all?

think you!

Added by Wojciech Kapcia TigaseTeam about 3 years ago

You need to establish connection from XMPP client and then you can either send those stanzas (IQs) directly or, if you are using capable XMPP client library - use it's API calls for desired actions.

Added by cheng cheng about 3 years ago

Can you tell me How to create a iq to sending a iq with PubSubComponent?

think you?

(1)

Added by cheng cheng about 3 years ago

I am the server ,how to send a IQ to client.

(1)

Added by cheng cheng about 3 years ago

I send IQ like this "";

but received "S2S - destination host not found"

why?

(1)

Added by Wojciech Kapcia TigaseTeam about 3 years ago

You are addressing the stanza wrong -- to='pubsub.shakespeare.lit'@. It looks like you've configured your server to utilize @gang VHost, therefore you should use pubsub.gang address.

Added by cheng cheng about 3 years ago

thinks.the problem disappear when i change;

but it show ""

the cheng-2@gang is the user_id in table tig_users,and jid in table user_jid.

Is there any problem?

(1)

Added by Daniel Wisnewski IoT 1 Cloud about 3 years ago

You need to first create the node before you can subscribe to it. You can use the following stanza to create the princely_musings node:

<iq type='set'

from='cheng-1@gang/app'

to='pubsub.gang'

id='create1'>
<create node='princely_musings'/>

You should be able to subscribe once that is sent.

    (1-9/9)