-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mod_event_pusher_http
doesn't handle muc_light messages
#2363
Comments
I'm not sure it was worked at MongooseIM 3.2.0, I forgot backup. |
I never wrote Erlang before, I tried to build my own %%%----------------------------------------------------------------------
%%% File : mod_event_pusher_http_custom.erl
%%% Author : Baibossynv Valery <baibossynov.valery@gmail.com>
%%% Purpose : Message passing via http
%%% Created : 23 Feb 2075 by Piotr Nosek
%%%----------------------------------------------------------------------
-module(mod_event_pusher_http_custom).
-author("baibossynov.valery@gmail.com").
-behaviour(mod_event_pusher_http).
%% API
-export([should_make_req/6, prepare_body/7, prepare_headers/7]).
%% @doc This function determines whether to send http notification or not.
%% Can be reconfigured by creating a custom module implementing should_make_req/3
%% and adding it to mod_event_pusher_http settings as {callback_module}
%% Default behaviour is to send all chat messages with non-empty body.
should_make_req(_Acc, out, _Packet, _From, _To, _Opts) ->
true;
should_make_req(Acc, in, Packet, From, To, _Opts) ->
true.
prepare_body(_Acc, _Dir, Host, Message, Sender, Receiver, _Opts) ->
cow_qs:qs([{<<"author">>, Sender},
{<<"server">>, Host}, {<<"receiver">>, Receiver}, {<<"message">>, Message}]).
prepare_headers(_Acc, _Dir, _Host, _Sender, _Receiver, _Message, _Opts) ->
[{<<"Content-Type">>, <<"application/x-www-form-urlencoded">>}]. then
Still no luck, looks like it doesn't listen messages from MUC light domain. Is this by design? any tip to solve this? many thanks! |
Hi @jasl Is this issue stil valid? If so, with your custom module, do you see any errors in the logs? It is true that default HTTP backend callback ignores everything except for 1-1 chat messages. The custom code should at least push something. |
@fenek I'll retry now |
@fenek The issue still valid on latest master commit with my custom pusher module
I try this using Rest API
MongooseIM foreground outputs
My Rails backend output
|
Given that only some MUC Light messages are sent (i.e. no other events are pushed via HTTP for sure), what are the values of these metrics?
|
I'm not trying metrics yet. |
after upgrade to 3.5.0, the issue still exists, Here's a Debug level log output
|
This is actually very strange because with your The config I've used is:
with default nginx from Docker running on port 80, so I can see if any requests are made.
Obviously I'm getting 404 errors but at least something is delivered to the REST endpoint:
|
Could you please try the same? I mean calling local web server to eliminate a problem with the real endpoint or the network. |
@fenek |
Any news on this issue? :) |
@fenek Sorry I'm not working on this in these weeks, maybe next week I would have time to try. Update (hope not disturb people): I'm too busy these months, will look this at December |
Sorry for respond long time! It's no problem now. I simply bought a new computer and the problem disappeared. |
MongooseIM version: 3.4
Installed from: source
Erlang/OTP version: 22
Normal user to user chat works great, but I found my http service doesn't receive messages from muc light room.
Shame of me I don't know what's wrong.
here's my
mongooseim.cfg
The text was updated successfully, but these errors were encountered: