I am getting below error while consuming message on rabbit mq through fanout approach :
2022-08-24 12:53:29.559 ERROR 42 --- [2.20.43.29:5672] o.s.a.r.c.CachingConnectionFactory : Channel shutdown: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'type' for exchange 'avitas.nodedata' in vhost 'avitas': received 'topic' but current is 'fanout', class-id=40, method-id=10)
We have a error log file from Jmeter , that we need to be pushing to elastic using logstash
Here is the log file , we wanna be pushing the data from line 5 ,
2021-05-14 20:32:49,822 INFO o.a.j.u.JMeterUtils: Setting Locale to en_EN
2021-05-14 20:32:49,842 INFO o.a.j.JMeter: Loading user properties from: user.properties
2021-05-14 20:32:49,843 INFO o.a.j.JMeter: Loading system properties from: system.properties
2021-05-14 20:32:49,844 WARN o.a.j.JMeter: LogLevel: ERROR
2021-05-14 20:32:51,824 ERROR o.a.j.e.J.JSR223 PostProcessor: Http URL/API Test 1-4: ; response received: {"timestamp":"2021-05-14T14:32:51.688+0000","status":404,"error":"Not Found","message":"No message available","path":"/healths"}
2021-05-14 20:32:51,824 ERROR o.a.j.e.J.JSR223 PostProcessor: Http URL/API Test 1-7: ; response received: {"timestamp":"2021-05-14T14:32:51.689+0000","status":404,"error":"Not Found","message":"No message available","path":"/healths"}
2021-05-14 20:32:51,824 ERROR o.a.j.e.J.JSR223 PostProcessor: Http URL/API Test 1-20: ; response received: {"timestamp":"2021-05-14T14:32:51.850+0000","status":404,"error":"Not Found","message":"No message available","path":"/healths"}
2021-05-14 20:32:51,824 ERROR o.a.j.e.J.JSR223 PostProcessor: LEX 2-1: ; response received: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header><ns3:systemContext xmlns:ns3="urn:abc.mon.utils.v1.context"><systemId>TREX</systemId><correlationId>hgfhjghj-c62dsfsdfdb-4aff-a871-8f32088943b3</correlationId></ns3:systemContext></SOAP-ENV:Header><SOAP-ENV:Body><ns3:retrieveStopPayResponse xmlns:ns3="urn:abc.tailhead.readyforcheck.processStopPay"><retrieveGagaPayResponse recordFound="false"><checkNumber/><stopPayDate/></retrieveGagaPayResponse></ns3:retrieveStopPayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
2021-05-14 20:32:51,824 ERROR o.a.j.e.J.JSR223 PostProcessor: Http URL/API Test 1-5: ; response received: {"timestamp":"2021-05-14T14:32:51.687+0000","status":404,"error":"Not Found","message":"No message available","path":"/healths"}
We want to be pushing data from line 4 specifically PostProcessor: , response received: to elastic. The below conf is just for response received:
here is the logstash conf
if [type] == "errors"{
grok {
match => {"message" => "%{GREEDYDATA}#*response received: %{GREEDYDATA:error_message}"}
}
}
We get an error Grok parse failure _grokparsefailure when we try to push
Not sure what am I missing here
Something like this should work for you:
%{TIMESTAMP_ISO8601:timestamp} %{WORD:LogType} %{GREEDYDATA:data1} PostProcessor: %{GREEDYDATA:data2} ; response received: %{GREEDYDATA:responseRecd}
Example 1:
2021-05-14 20:32:51,824 ERROR o.a.j.e.J.JSR223 PostProcessor: Http URL/API Test 1-4: ; response received: {"timestamp":"2021-05-14T14:32:51.688+0000","status":404,"error":"Not Found","message":"No message available","path":"/healths"}
Output :
{
"timestamp": [
[
"2021-05-14 20:32:51,824"
]
],
"LogType": [
[
"ERROR"
]
],
"data1": [
[
"o.a.j.e.J.JSR223"
]
],
"data2": [
[
"Http URL/API Test 1-4:"
]
],
"responseRecd": [
[
"{"timestamp":"2021-05-14T14:32:51.688+0000","status":404,"error":"Not Found","message":"No message available","path":"/healths"}"
]
]
}
Example 2 :
2021-05-14 20:32:51,824 ERROR o.a.j.e.J.JSR223 PostProcessor: LEX 2-1: ; response received: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header><ns3:systemContext xmlns:ns3="urn:abc.mon.utils.v1.context"><systemId>TREX</systemId><correlationId>hgfhjghj-c62dsfsdfdb-4aff-a871-8f32088943b3</correlationId></ns3:systemContext></SOAP-ENV:Header><SOAP-ENV:Body><ns3:retrieveStopPayResponse xmlns:ns3="urn:abc.tailhead.readyforcheck.processStopPay"><retrieveGagaPayResponse recordFound="false"><checkNumber/><stopPayDate/></retrieveGagaPayResponse></ns3:retrieveStopPayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
Output :
{
"timestamp": [
[
"2021-05-14 20:32:51,824"
]
],
"LogType": [
[
"ERROR"
]
],
"data1": [
[
"o.a.j.e.J.JSR223"
]
],
"data2": [
[
"LEX 2-1:"
]
],
"responseRecd": [
[
"<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header><ns3:systemContext xmlns:ns3="urn:abc.mon.utils.v1.context"><systemId>TREX</systemId><correlationId>hgfhjghj-c62dsfsdfdb-4aff-a871-8f32088943b3</correlationId></ns3:systemContext></SOAP-ENV:Header><SOAP-ENV:Body><ns3:retrieveStopPayResponse xmlns:ns3="urn:abc.tailhead.readyforcheck.processStopPay"><retrieveGagaPayResponse recordFound="false"><checkNumber/><stopPayDate/></retrieveGagaPayResponse></ns3:retrieveStopPayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>"
]
]
}
I have given dummy names as data1 and data2. You can separate them out further as per your needs.
Please use Grok Debugger for debugging.
^%{GREEDYDATA}ERROR%{GREEDYDATA}response received: %{GREEDYDATA:error_message}
I'm trying to set up a socket.io connection, but the connection keeps closing with a transport error message. Both, client and server, are running socket.io v2.0.3.
Client
var _socket = io({
transports: ['websocket'],
query: {
token: userToken,
roomName: getRoomName(),
},
});
messages:
socket.io-client:manager attempting reconnect +5s
socket.io.min.js:1 socket.io-client:manager readyState closed +0ms
socket.io.min.js:1 socket.io-client:manager opening https://video.twoseven.xyz +1ms
socket.io.min.js:1 engine.io-client:socket creating transport "websocket" +1ms
socket.io.min.js:1 engine.io-client:socket setting transport websocket +1ms
socket.io.min.js:1 socket.io-client:manager connect attempt will timeout after 20000 +2ms
socket.io.min.js:2 WebSocket connection to 'wss://video.twoseven.xyz/socket.io/?token=abcd&roomName=us&EIO=3&transport=websocket' failed: Invalid frame header
r.doOpen # socket.io.min.js:2
r.open # socket.io.min.js:2
r.open # socket.io.min.js:1
r # socket.io.min.js:1
r # socket.io.min.js:1
r.open.r.connect # socket.io.min.js:1
(anonymous) # socket.io.min.js:1
socket.io.min.js:1 engine.io-client:socket socket error {"type":"TransportError","description":{"isTrusted":true}} +733ms
socket.io.min.js:1 socket.io-client:manager connect_error +1ms
socket.io.min.js:1 socket.io-client:manager cleanup +0ms
socket.io.min.js:1 socket.io-client:manager reconnect attempt error +1ms
socket.io.min.js:1 socket.io-client:manager will wait 4769ms before reconnect attempt +1ms
socket.io.min.js:1 engine.io-client:socket socket close with reason: "transport error" +0ms
The Chrome developer console reports the following from the network tab:
General
Request URL:wss://video.twoseven.xyz/socket.io/?token=abcd&roomName=us&EIO=3&transport=websocket
Request Method:GET
Status Code:101 Switching Protocols
Response Headers
Connection:upgrade
Date:Thu, 19 Oct 2017 22:36:52 GMT
Sec-WebSocket-Accept:YJ3aZ2L+X+ANa1bJK3ECO/s7XVE=
Sec-WebSocket-Extensions:permessage-deflate
Server:nginx/1.11.8
Upgrade:websocket
Server
const io = new socketio(server, {pingInterval: 3000, pingTimeout: 10000});
io.set('transports', ['websocket']);
messages:
engine handshaking client "yrFJADAHt-QQZsX6AAAA" +0ms
engine:socket sending packet "open" ({"sid":"yrFJADAHt-QQZsX6AAAA","upgrades":[],"pingInterval":3000,"pingTimeout":10000}) +3ms
engine:socket flushing buffer to transport +1ms
engine:ws writing "0{"sid":"yrFJADAHt-QQZsX6AAAA","upgrades":[],"pingInterval":3000,"pingTimeout":10000}" +1ms
engine:transport setting request +1ms
engine:socket sending packet "message" (0) +9ms
engine:socket flushing buffer to transport +19ms
engine:ws writing "40" +1ms
engine:socket sending packet "message" (2["authenticated"]) +91ms
engine:socket flushing buffer to transport +0ms
engine:ws writing "42["authenticated"]" +1ms
engine:socket transport error +136ms
engine:ws closing +2ms
From the server logs, I see that the connection event has been triggered and executes fine except for the last line which says socket.emit('authenticated');. The transport seems to fail at this point
In my application, a user can restart a video from the beginning after it has ended.
To implement this, I have overridden in the custom receiver the receiver library MediaManager.onEnded() method, and send a custom message to the sender, rather than calling resetMediaElement, which is the default behavior of this method.
At this point, the user hits a play button, and the sender calls the RemoteMediaPlayer.play() method, which should cause the receiver library to call the play() method on the <video> element.
But instead, the receiver library sends back a message saying INVALID REQUEST, INVALID_MEDIA_SESSSION_ID.
Also. the receiver library has logged a message saying "
Unexpected command, player is in the IDLE state so the media session ID is not yet valid
But the last state update from the receiver shows the player in the PLAYING state in both the receiver and sender logs.
Here is the receiver log:
::mmOnLoad() mediacast.js:480
url: http://192.168.1.50/apps/chromecast/videos/Inside%20Diamond%20Head-0001.mp4 mediacast.js:498
duration: 0 mediacast.js:500
::showVideo()- message:[object Object] mediacast.js:257
url:http://192.168.1.50/apps/chromecast/videos/Inside%20Diamond%20Head-0001.mp4 mediacast.js:259
::fadeOutOldMediaElement() mediacast.js:384
::mmOnLoad()- presenting video from http://192.168.1.50/apps/chromecast/videos/Inside%20Diamond%20Head-0001.mp4, duration 0 mediacast.js:552
::fadeOutOldMediaElement0() mediacast.js:393
::videoFadedOut()- url: http://192.168.1.50/apps/chromecast/videos/Inside%20Diamond%20Head-0001.mp4 mediacast.js:265
::videoFadedOut()- setting media element [object HTMLVideoElement] mediacast.js:279
::removeMediaElementOrOverlay() mediacast.js:398
::removeOldMediaElement() mediacast.js:432
::removeOverlay() mediacast.js:427
[ 40.701s] [cast.receiver.MediaManager] Metadata loaded
cast_receiver.javascript:574
[ 40.736s] [cast.receiver.MediaManager] Sending broadcast status message
cast_receiver.javascript:574
>>>>>the media element state is paused mediacast.js:603
media element networkState = 2, readyState = 1 mediacast.js:605
[ 40.802s] [cast.receiver.IpcChannel] IPC message sent: {"namespace":"urn:x-cast:com.google.cast.media","senderId":"*:*","data":"{\"type\":\"MEDIA_STATUS\",\"status\":[{\"mediaSessionId\":1,\"playbackRate\":1,\"playerState\":\"PAUSED\",\"currentTime\":0,\"supportedMediaCommands\":15,\"volume\":{\"level\":0.06666666666666667,\"muted\":false},\"media\":{\"customData\":{\"volume\":0.06666666666666667,\"pauseAfter\":true,\"pauseBefore\":true,\"rotation\":0},\"streamType\":\"BUFFERED\",\"duration\":42.4,\"contentType\":\"video/mp4\",\"contentId\":\"http://192.168.1.50/apps/chromecast/videos/Inside%20Diamond%20Head-0001.mp4\",\"metadata\":{\"metadataType\":1}}}],\"requestId\":1}"}
cast_receiver.javascript:574
::videoLoaded() mediacast.js:291
::videoLoaded0() mediacast.js:302
::addVideo() mediacast.js:421
::videoLoaded1() mediacast.js:309
[ 48.434s] [cast.receiver.IpcChannel] Received message: {"data":"{\"type\":\"PLAY\",\"requestId\":2,\"mediaSessionId\":1}","namespace":"urn:x-cast:com.google.cast.media","senderId":"51:name.renkel.james.mediacast-6"}
cast_receiver.javascript:574
[ 48.440s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message [urn:x-cast:com.google.cast.media, 51:name.renkel.james.mediacast-6]: {"type":"PLAY","requestId":2,"mediaSessionId":1}
cast_receiver.javascript:574
[ 48.446s] [cast.receiver.MediaManager] MediaManager message received [51:name.renkel.james.mediacast-6] {"type":"PLAY","requestId":2,"mediaSessionId":1}
cast_receiver.javascript:574
[ 48.449s] [cast.receiver.MediaManager] Dispatching MediaManager play event
cast_receiver.javascript:574
[ 48.457s] [cast.receiver.MediaManager] onPlay
cast_receiver.javascript:574
[ 48.473s] [cast.receiver.MediaManager] Sending broadcast status message
cast_receiver.javascript:574
>>>>>the media element state is buffering mediacast.js:603
media element networkState = 1, readyState = 4 mediacast.js:605
[ 48.491s] [cast.receiver.IpcChannel] IPC message sent: {"namespace":"urn:x-cast:com.google.cast.media","senderId":"*:*","data":"{\"type\":\"MEDIA_STATUS\",\"status\":[{\"mediaSessionId\":1,\"playbackRate\":1,\"playerState\":\"BUFFERING\",\"currentTime\":0.033322,\"supportedMediaCommands\":15,\"volume\":{\"level\":0.06666666666666667,\"muted\":false}}],\"requestId\":2}"}
cast_receiver.javascript:574
[ 49.071s] [cast.receiver.MediaManager] Buffering state changed, isPlayerBuffering: false old time: 0.033322 current time: 0.433322
cast_receiver.javascript:574
[ 49.077s] [cast.receiver.MediaManager] Sending broadcast status message
cast_receiver.javascript:574
>>>>>the media element state is playing mediacast.js:603
media element networkState = 2, readyState = 4 mediacast.js:605
[ 49.090s] [cast.receiver.IpcChannel] IPC message sent: {"namespace":"urn:x-cast:com.google.cast.media","senderId":"*:*","data":"{\"type\":\"MEDIA_STATUS\",\"status\":[{\"mediaSessionId\":1,\"playbackRate\":1,\"playerState\":\"PLAYING\",\"currentTime\":0.433322,\"supportedMediaCommands\":15,\"volume\":{\"level\":0.06666666666666667,\"muted\":false}}],\"requestId\":0}"}
cast_receiver.javascript:574
::onEnded(VIDEO) mediacast.js:369
::onEnded- network state:1 mediacast.js:370
::onEnded- ready state:4 mediacast.js:371
::onEnded- paused:true mediacast.js:372
::onEnded- ended:true mediacast.js:373
::sendMessage({"indication":"ended"}) mediacast.js:108
[ 90.955s] [cast.receiver.IpcChannel] IPC message sent: {"namespace":"urn:x-cast:name.renkel.james.mediacast","senderId":"51:name.renkel.james.mediacast-6","data":"{\"indication\":\"ended\"}"}
cast_receiver.javascript:574
[110.341s] [cast.receiver.IpcChannel] Received message: {"data":"{\"type\":\"PLAY\",\"requestId\":3,\"mediaSessionId\":1}","namespace":"urn:x-cast:com.google.cast.media","senderId":"51:name.renkel.james.mediacast-6"}
cast_receiver.javascript:574
[110.350s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message [urn:x-cast:com.google.cast.media, 51:name.renkel.james.mediacast-6]: {"type":"PLAY","requestId":3,"mediaSessionId":1}
cast_receiver.javascript:574
[110.358s] [cast.receiver.MediaManager] Unexpected command, player is in IDLE state so the media session ID is not valid yet
cast_receiver.javascript:574ib cast_receiver.javascript:574gb.Gb cast_receiver.javascript:562B.log cast_receiver.javascript:361E cast_receiver.javascript:412Z.M cast_receiver.javascript:1654W.ra cast_receiver.javascript:1181Hb cast_receiver.javascript:885g.dispatchEvent cast_receiver.javascript:856g.M cast_receiver.javascript:1104Hb cast_receiver.javascript:885g.dispatchEvent cast_receiver.javascript:856g.M cast_receiver.javascript:968
[110.362s] [cast.receiver.MediaManager] Sending error message to 51:name.renkel.james.mediacast-6
cast_receiver.javascript:574
[110.368s] [cast.receiver.IpcChannel] IPC message sent: {"namespace":"urn:x-cast:com.google.cast.media","senderId":"51:name.renkel.james.mediacast-6","data":"{\"requestId\":3,\"type\":\"INVALID_REQUEST\",\"reason\":\"INVALID_MEDIA_SESSION_ID\"}"}
cast_receiver.javascript:574
And here is the sender log:
11-10 13:36:36.631: D/MC_Sender(15051): ::showVideo()- url: http://192.168.1.50/apps/chromecast/videos/Inside%20Diamond%20Head-0001.mp4 11-10 13:36:36.732: D/MC_MainActivity.PagerAdapter(15051): ::setPrimaryItem(0)
11-10 13:36:36.732: D/MC_MainActivity(15051): ::setContentPosition(0)
11-10 13:36:40.325: D/MC_MediaPlayer(15051): ::onMessageReceived(): device-TV Room; namespace-urn:x-cast:com.google.cast.media; message-{"type":"MEDIA_STATUS","status":[{"mediaSessionId":2,"playbackRate":1,"playerState":"PAUSED","currentTime":0,"supportedMediaCommands":15,"volume":{"level":0.06666666666666667,"muted":false},"media":{"customData":{"volume":0.06666666666666667,"pauseAfter":true,"pauseBefore":true,"rotation":0},"streamType":"BUFFERED","duration":42.4,"contentType":"video/mp4","contentId":"http://192.168.1.50/apps/chromecast/videos/Inside%20Diamond%20Head-0001.mp4","metadata":{"metadataType":1}}}],"requestId":4}
11-10 13:36:40.375: D/MC_Listeners(15051): ::onStatusUpdated()- playerState=PAUSED
11-10 13:36:40.426: D/MC_Runner(15051): ::onSenderStateChange(PAUSED)- runState=LOADING
11-10 13:36:40.426: D/MC_Runner(15051): ::setRunState(RUNNING)- stopWhenRunning=false
11-10 13:36:40.426: D/MC_CastFragment(15051): ::runnerUpdate()
11-10 13:36:40.456: D/MC_Listeners(15051): ::onStatusUpdated()- playerState=PAUSED
11-10 13:36:40.456: D/MC_Listeners(15051): ::onMetadataUpdated()- mediaType=MOVIE
11-10 13:36:40.516: D/MC_MainActivity.PagerAdapter(15051): ::setPrimaryItem(0)
11-10 13:36:40.516: D/MC_MainActivity(15051): ::setContentPosition(0)
11-10 13:36:40.806: D/MC_Sender(15051): ::loadMedia()- statusCode: 0; success: true
11-10 13:36:40.806: D/MC_Runner(15051): LoadCallback::callback(true): wasStopped=false
...
11-10 13:38:47.201: D/MC_Sender(15051): ::playMedia()
11-10 13:38:47.391: D/MC_MediaPlayer(15051): ::onMessageReceived(): device-TV Room; namespace-urn:x-cast:com.google.cast.media; message-{"type":"MEDIA_STATUS","status":[{"mediaSessionId":1,"playbackRate":1,"playerState":"BUFFERING","currentTime":0.033322,"supportedMediaCommands":15,"volume":{"level":0.06666666666666667,"muted":false}}],"requestId":2}
11-10 13:38:47.411: D/MC_Listeners(15051): ::onStatusUpdated()- playerState=BUFFERING
11-10 13:38:47.531: D/MC_Runner(15051): ::onSenderStateChange(BUFFERING)- runState=RUNNING
11-10 13:38:47.671: D/MC_MainActivity.PagerAdapter(15051): ::setPrimaryItem(0)
11-10 13:38:47.671: D/MC_MainActivity(15051): ::setContentPosition(0)
11-10 13:38:48.372: D/MC_Sender(15051): ::playMedia()- statusCode: 0; success: true
11-10 13:38:48.382: D/MC_MediaPlayer(15051): ::onMessageReceived(): device-TV Room; namespace-urn:x-cast:com.google.cast.media; message-{"type":"MEDIA_STATUS","status":[{"mediaSessionId":1,"playbackRate":1,"playerState":"PLAYING","currentTime":0.6,"supportedMediaCommands":15,"volume":{"level":0.06666666666666667,"muted":false}}],"requestId":0}
...
11-10 13:39:29.736: D/MC_Listeners(15051): ::onMessageReceived()- nameSpace: urn:x-cast:name.renkel.james.mediacast; message: {"indication":"ended"}
11-10 13:39:29.806: D/MC_Runner(15051): ::onSenderStateChange(ENDED)- runState=RUNNING
...
11-10 13:42:19.918: D/MC_CastFragment(15051): ::onClick()
11-10 13:42:19.918: D/MC_Sender(15051): ::playMedia()
11-10 13:42:20.398: D/MC_MediaPlayer(15051): ::onMessageReceived(): device-TV Room; namespace-urn:x-cast:com.google.cast.media; message-{"requestId":3,"type":"INVALID_REQUEST","reason":"INVALID_MEDIA_SESSION_ID"}
11-10 13:42:20.418: D/MC_Sender(15051): ::playMedia()- statusCode: 1; success: false
I believe that once the video ends, it goes to an IDLE state whether resetMediaElement is called or not. There's different reasons why the status might be IDLE that you can specify: https://developers.google.com/cast/docs/reference/receiver/cast.receiver.media.IdleReason.
It's a bit roundabout, but based on the methods listed at https://developers.google.com/cast/docs/reference/receiver/cast.receiver.MediaManager, you could:
1) check if the video successfully finished playing
2) set the idle reason as cast.receiver.media.IdleReason.FINISHED
Then, in your sender, you can override customizedStatusCallback() to check the status and idle reason and change the status before sending it to your sender so that it can replay correctly.