Configure pubsub node to send normal message

Hello,

I am creating pubsub node by using,

    // Create a pubsub manager using an existing XMPPConnection
    PubSubManager mgr = PubSubManager.getInstance(connection);

    // Create the node
    ConfigureForm form = new ConfigureForm(DataForm.Type.submit);
    form.setAccessModel(AccessModel.open);
    form.setDeliverPayloads(true);
    form.setNotifyRetract(true);
    form.setPersistentItems(true);
    form.setPublishModel(PublishModel.publishers);
    form.setAnswer("pubsub#notification_type", "normal");
    Node leaf = mgr.createNode(nodeName, form);

and node created successfully. But my question is,

how to configure pubsub node to send normal message instead of headline using smack??

You need to set ‘pubsub#notification_type’ to ‘normal’. The PubSub configuration form currently has no high level API for that, thus you need to use the API of the Form one layer below:

form.setAnswer("pubsub#notification_type", "normal");

Thanks for the reply.

What does
"The PubSub configuration form currently has no high level API for that, thus you need to use the API of the Form one layer below"
this mean?

Because as I have given in the sample code, I am doing this already.
(form.setAnswer("pubsub#notification_type", "normal");)

So please tell me what am I doing wrong here? And what is the right way?

I think that should do the trick. I’d look at the PubSub service implementation what is going on.

Thanks for giving replay,

(form.setAnswer(“pubsub#notification_type”, “normal”)

After adding this configuration bellow exception is occurs while creating node in pubsub,

java.lang.IllegalArgumentException: Field not found for the specified variable name.
at org.jivesoftware.smackx.xdata.Form.setAnswer

Give me correct way ??

Hello,
Any update???
Please give me any solution For this…