I'm a new RabbitMQ user, I'm trying to update an Android application that uses the mqtt protocol. Using RabbitMQ version 3.8.28, I have in the logFile:
[error] <0.1608.0> Channel error on connection <0.1588.0> (192.168.0.14:50526 -> 192.168.0.14:1883, vhost: '/', user: 'admin'), channel 2:
operation queue.declare caused a channel exception not_found: no queue 'mqtt-subscription-mobile_P093821992223818qos1' in vhost '/'
2022-03-30 15:55:51.147 [info] <0.1585.0> accepting MQTT connection <0.1585.0> (192.168.0.14:50526 -> 192.168.0.14:1883, client id: mobile_P093821992223818)
The queue mqtt-subscription-mobile_P093821992223818qos1 is automatically generated, however in the new version 3.9.14, the error does not appear in the log file and the queue is not generated.
Can someone tell me how can I generate the queue in the new version?
Thank you
Related
I'm getting this error when trying to connect to the server I opened locally.
It converts ws to http. and put a # sign at the end.
Socket:
final channel = IOWebSocketChannel.connect(Uri.parse('ws://192.168.1.226:10600'));
**Error: **
Restarted application in 1.052ms. D/EGL_emulation(14743): app_time_stats: avg=8757.14ms min=3.84ms max=218720.27ms count=25 E/flutter (14743): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: WebSocketException: Connection to 'http://192.168.1.226:10600#' was not upgraded to websocket
The server was created with .net 4.8.
I would be glad if you help
I want to show the messages sent by the server in the application.
I am trying to connect to an AWS MQTT broker/server using the Hive MQ client library for Android Studio (v1.3.0) with an AWS pre-signed URL.
implementation("com.hivemq:hivemq-mqtt-client:1.3.0")
implementation(platform("com.hivemq:hivemq-mqtt-client-websocket:1.3.0"))
The parameters I am using are shown below with the sensitive information removed:
host: xxx.amazonaws.com
path: /mqtt?X-Amz-Algorithm=xxx&X-Amz-Credential=xxx&X-Amz-Date=xxx&X-Amz-SignedHeaders=host&X-Amz-Signature=xxx
This is my latest attempt to connect:
MqttClient.builder()
.identifier(UUID.randomUUID().toString())
.serverHost(host)
.webSocketConfig()
.serverPath(path)
.applyWebSocketConfig()
.sslWithDefaultConfig()
.useMqttVersion3()
.build()
But when connecting, I get the error:
com.hivemq.client.mqtt.exceptions.ConnectionFailedException:
io.netty.handler.codec.http.websocketx.WebSocketHandshakeException:
Invalid handshake response getStatus: 426 Upgrade Required
trying to connect ROS v1.8.3 with android realm 4.1.0, but got an error on connection:
Connection[1]: Writing failed: End of input
Connection[1]: Connection closed due to error
Connection[1]: Reconnecting in 472 milliseconds
Connection[1]: Resolving 'ec2....us-west-2.compute.amazonaws.com:9080'
Connection[1]: Connecting to endpoint '34.215.139.88:9080' (1/1)
Connection[1]: Connected to endpoint '34.215.139.88:9080' (from '10.0.2.15:35808')
Connection[1]: WebSocket::initiate_client_handshake()
Connection[1]: HTTP request =
GET /realm-sync/%2F0e38f9551d63d9e08f0d0bf%2Faccount HTTP/1.1
Authorization: Realm-Access-Token version=1 token="ey.......=="
Connection: Upgrade
Host: ec.....us-west-2.compute.amazonaws.com
Sec-WebSocket-Key: azTr3bmRnl1FbSvLCK0pvA==
Sec-WebSocket-Protocol: io.realm.sync.22
Sec-WebSocket-Version: 13
Upgrade: websocket
is it version incompatibility issue?
previously it works well with realm 3.4.0 build. only changes i've made during migration:
project gradle:
classpath "io.realm:realm-gradle-plugin:4.1.0"
gradle:
android {
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.2'
}
code (added <SyncUser>):
SyncUser.loginAsync(syncCred, serverH, new SyncUser.Callback <SyncUser> () {...
application have been deleted from phone before install with new realm build.
is some other options required?
logs on server:
sync: HTTP Connection[2165]: Connection is closed after HTTP response.
sync: HTTP Connection[2165]: 404 Not Found
sync: HTTP Connection[2165]: HTTP request received, url
sync: HTTP Connection[2165]: Connection initiates HTTP receipt
proxy: attempting to upgrade client ::ffff:93.85.144.134:48862 => headers: {"authorization":"Realm-Access-Token version=1 token=\"eyJhY...Q==\"","connection":"Upgrade","host":"ec....us-west-2.compute.amazonaws.com","sec-websocket-key":"Wtpq5fNSWwwJicg8E8/RTQ==","sec-websocket-protocol":"io.realm.sync.22","sec-websocket-version":"13","upgrade":"websocket"}.}
Realm 4.0.0 was updated to use Realm Sync 2.0.x, which requires ROS 2.0 which is most likely incompatible with ROS 1.x.
The last version to use Realm Sync 1.x is 3.7.2.
I have Xmpp stack based on Ejabberd(version 16.04) and Smack client library(4.17 on Android).
I'm facing a situation where messages sent by server get dropped, when the client goes offline temporarily. Here are the steps I use to replicate the situation, along with the logs from ejabberd.
1- Client A goes online
2016-06-19 01:22:59.834 [info] <0.505.0>#ejabberd_listener:accept:333 (#Port<0.19955>) Accepted connection 122.172.241.21:26683 -> 139.162.34.247:5222
2016-06-19 01:23:00.449 [info] <0.667.0>#ejabberd_c2s:wait_for_sasl_response:900 ({socket_state,gen_tcp,#Port<0.19955>,<0.666.0>}) Accepted authentication for 9739937980 by undefined from 122.172.241.21
2016-06-19 01:23:00.619 [info] <0.667.0>#ejabberd_c2s:open_session:1111 ({socket_state,gen_tcp,#Port<0.19955>,<0.666.0>}) Opened session for 9739937980#gappi.in/Smack
2016-06-19 01:23:00.698 [info] <0.667.0>#ejabberd_c2s:handle_enable:2700 Stream management with resumption enabled for 9739937980#gappi.in/Smack
2 - Client A is disconnected uncleanly(wifi disconnected or app is killed)
2016-06-19 01:27:57.582 [info] <0.667.0>#ejabberd_c2s:fsm_next_state:2454 Waiting for resumption of stream for 9739937980#gappi.in/Smack
3 - Other client/bots send message to client A
4 - Client A comes back on line after a short while( 60 seconds)
2016-06-19 01:28:39.367 [info] <0.505.0>#ejabberd_listener:accept:333 (#Port<0.19963>) Accepted connection 122.172.241.21:26543 -> 139.162.34.247:5222
2016-06-19 01:28:40.050 [info] <0.684.0>#ejabberd_c2s:wait_for_sasl_response:900 ({socket_state,gen_tcp,#Port<0.19963>,<0.683.0>}) Accepted authentication for 9739937980 by undefined from 122.172.241.21
2016-06-19 01:28:40.213 [info] <0.684.0>#ejabberd_c2s:open_session:1111 ({socket_state,gen_tcp,#Port<0.19963>,<0.683.0>}) Opened session for 9739937980#gappi.in/Smack
2016-06-19 01:28:40.214 [info] <0.667.0>#ejabberd_c2s:terminate:1758 ({socket_state,gen_tcp,#Port<0.19955>,<0.666.0>}) Replaced session for 9739937980#gappi.in/Smack
2016-06-19 01:28:40.215 [info] <0.667.0>#ejabberd_c2s:handle_unacked_stanzas:2872 2 stanzas were not acknowledged by 9739937980#gappi.in/Smack
2016-06-19 01:28:40.302 [info] <0.684.0>#ejabberd_c2s:handle_enable:2700 Stream management with resumption enabled for 9739937980#gappi.in/Smack
Now, here ejabberd tells me that it hasn't received acknowledgement for pending messages
2 stanzas were not acknowledged by 9739937980#gappi.in/Smack. Moreover, the messages are not received by Smack library and are dropped.
So obviously, Smack client library is not sending proper acks for the messages after reconnecting. I've tried enabling Stream Management(XEP-198) in my client library code, but its not working. My Smack client connection code looks like:
XMPPTCPConnectionConfiguration.Builder config = XMPPTCPConnectionConfiguration
.builder();
config.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);
config.setServiceName(serverAddress);
config.setHost(serverAddress);
config.setPort(5222);
config.setDebuggerEnabled(true);
XMPPTCPConnection.setUseStreamManagementDefault(true);
XMPPTCPConnection.setUseStreamManagementResumptionDefault(true);
connection = new XMPPTCPConnection(config.build());
connection.setUseStreamManagement(true);
connection.setUseStreamManagementResumption(true);
What changes do I need to avoid those dropped messages?
Thanks.
I figured it out myself.
There was a bug in my client side code. I was adding ChatMessageListener to the connection very late.
So even though ejabberd was re-sending the messages correctly on resume, without ChatMessageListener those messages were not being acked properly or stored to client side database.
I've recently compiled latest ejabberd code from github on my Arch linux machine. I'm new to ejabberd so I may have made a newbie mistake.
I'm facing an issue where in a particular scenario packets do not reach the target client. This happens if the message is sent after client gets disconnected but before client's session is closed due to resume_timeout.
I've followed instructions as mentioned over here https://www.ejabberd.im/faq/tcp , but still I've been unable to handle all cases.
The relevant parts of my ejabberd.yml look like
listen:
-
port: 5222
module: ejabberd_c2s
max_stanza_size: 65536
resend_on_timeout: true
resume_timeout: 60
shaper: c2s_shaper
access: c2s
-
## Not sure if resend_on_timeout is required here
port: 5280
module: ejabberd_http
resend_on_timeout: true
resume_timeout: 60
http_bind: true
modules:
...
mod_offline:
access_max_user_messages: max_user_offline_messages
mod_ping:
send_pings: true
ping_interval: 60
timeout_action: kill
Here's the output of ejabberd log corresponding to client's acitivites:
Client A disconnects uncleanly
2016-06-19 10:59:51.369 [info] <0.549.0>#ejabberd_c2s:fsm_next_state:2454 Waiting for resumption of stream for 9739937980#gappi.in/Smack`
Client B Logs in and sends a message to A
2016-06-19 11:00:00.320 [info] <0.510.0>#ejabberd_listener:accept:333 (#Port<0.19876>) Accepted connection 139.162.34.247:41186 -> 139.162.34.247:5222
2016-06-19 11:00:00.575 [info] <0.559.0>#ejabberd_c2s:wait_for_sasl_response:900 ({socket_state,fast_tls,{tlssock,#Port<0.19876>,#Port<0.19877>},<0.558.0>}) Accepted authentication for echo by undefined from 137
2016-06-19 11:00:00.715 [info] <0.559.0>#ejabberd_c2s:open_session:1111 ({socket_state,fast_tls,{tlssock,#Port<0.19876>,#Port<0.19877>},<0.558.0>}) Opened session for echo#gappi.in/13353511976792329881266
2016-06-19 11:00:00.776 [info] <0.559.0>#ejabberd_c2s:handle_enable:2700 Stream management with resumption enabled for echo#gappi.in/13353511976792329881266
2016-06-19 11:00:00.984 [info] <0.559.0>#ejabberd_c2s:terminate:1778 ({socket_state,fast_tls,{tlssock,#Port<0.19876>,#Port<0.19877>},<0.558.0>}) Close session for echo#gappi.in/13353511976792329881266
Client A session is finally closed due to resume_timeout
2016-06-19 11:00:51.370 [info] <0.549.0>#ejabberd_c2s:terminate:1778 ({socket_state,gen_tcp,#Port<0.19869>,<0.548.0>}) Close session for 9739937980#gappi.in/Smack
Client A logs back in
2016-06-19 11:01:14.078 [info] <0.510.0>#ejabberd_listener:accept:333 (#Port<0.19879>) Accepted connection 122.172.241.21:26597 -> 139.162.34.247:5222
2016-06-19 11:01:14.707 [info] <0.566.0>#ejabberd_c2s:wait_for_sasl_response:900 ({socket_state,gen_tcp,#Port<0.19879>,<0.565.0>}) Accepted authentication for 9739937980 by undefined from 122.172.241.21
2016-06-19 11:01:14.868 [info] <0.566.0>#ejabberd_c2s:open_session:1111 ({socket_state,gen_tcp,#Port<0.19879>,<0.565.0>}) Opened session for 9739937980#gappi.in/Smack
2016-06-19 11:01:14.966 [info] <0.566.0>#ejabberd_c2s:handle_enable:2700 Stream management with resumption enabled for 9739937980#gappi.in/Smack
As per this guide, https://www.ejabberd.im/faq/tcp, after the resume_timeout expires, the unacked messages should have been handled by mod_offline. But this is not happening.
Result : No message reaches client.
Any pointers?
This problem was due to a bug in Ejabberd https://github.com/processone/ejabberd/issues/1160 which has been fixed now.