I have some problems with the messaging module that I didn't have with previous versions. Just enter a channel name and press "Go". Nothing happens. Change it and press "Go". Nothing happens.
This was not happening with previous versions, since a lot of time passed since I implemented the messaging functionality in my site and it was working.
Using 6.0-p20160813 power. But this also happens with 27.09. Chrome 52.0.2743.116 (64-bit)
This was not happening with previous versions, since a lot of time passed since I implemented the messaging functionality in my site and it was working.
Using 6.0-p20160813 power. But this also happens with 27.09. Chrome 52.0.2743.116 (64-bit)
Code:
public class TestingModule implements EntryPoint {
@Override
public void onModuleLoad() {
final VLayout vlayout = new VLayout();
DynamicForm df = new DynamicForm();
final TextItem ti = new TextItem("cn", "channel name");
df.setFields(ti);
IButton button = new IButton("go!");
button.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Messaging.subscribe((String)ti.getValue(), new MessagingCallback() {
@Override
public void execute(Object data) {
SC.logWarn("Received: " + (String) data);
}
});
Record rec = new Record();
rec.setAttribute("channel", ti.getValue());
DataSource.get("testingDS").performCustomOperation("testMethod", rec, null);
}
});
vlayout.addMembers(df, button);
vlayout.draw();
}
}
Code:
public class TestingDMI {
private static final Logger LOG = Utils.getLogger(TestingDMI.class);
public DSResponse testMethod(DSRequest dsRequest) throws Exception {
LOG.info("TestingDMI: ExecuteMethod()");
String channel = (String) dsRequest.getValues().get("channel");
LOG.info("Channel: " + channel);
ISCMessageDispatcher dispatcher = ISCMessageDispatcher.instance();
for (int i = 0; i <= 500; i++) {
dispatcher.send(new ISCMessage(channel, "message " + i));
}
return new DSResponse();
}
}
Code:
<DataSource ID="testingDS" serverType="generic">
<operationBindings>
<operationBinding operationType="custom" operationId="testMethod">
<serverObject className="de.mks_infofabrik.kids.server.test.TestingDMI"
methodName="testMethod" />
</operationBinding>
</operationBindings>
</DataSource>
Comment