I try to send messsage to rabbitmq-server:
send_message(Channel, Host, Password, Message) ->
amqp_channel:cast(Channel, #'basic.publish'{exchange = <<"">>},
routing_key = <<"test">>,
#amqp_msg{payload = Message}).
But get error:
Error in process <0.431.0> with exit value:
{function_clause,[{gen_server,cast, [2,{cast,{'basic.publish',0,<<0
bytes>>,<<7 bytes>>,false,false},
{amqp_msg,{'P_basic',undefined,undefined,undefined,undefined,undefined,undefined,
undefined,undefined,undefined,undefined,undefined...
How can i fix it? How can i correctly send message to rabbitmq-server?
Thank you.
Check the value of Channel: from the stacktrace it shows that it is equal to 2, which is not a valid Pid.
The code calling send_message/4 must do something funky and not pass a valid Channel to it.
Related
I'm having trouble defining a message in the Gmail login code when the credentials are wrong.
def connect():
imap_host = 'imap.gmail.com'
email = 'cryp#gmail.com'
password = input("Password: ")
M = imaplib.IMAP4_SSL(imap_host)
M.login(email, password)
try:
os.system('cls')
print('Connected.')
except imaplib.IMAP4.error:
os.system('cls')
print('Failed to connect.')
connect()
Below is the message that appears.
raise self.error(dat[-1])
imaplib.error: b'[AUTHENTICATIONFAILED] Invalid credentials (Failure)'
and not this:
print('Falha ao Conectar.')
The message Connected appears correctly when I type the email and password correctly, however when I make an error this message appears instead of Failed to connect.
I'm starting out with Mirth and HL7 and I'm trying to send a message to a remote server. My MSH looks as follows:
MSH|^~\&|EPIC|EPIC|IMG_SCHEDULE_APPT|REMOTE|20170328193318|PERSONNAME|ORM^O01|12345678|T|2.4||||||||||
The response looks as follows:
MSH|^~\&|IMG_SCHEDULE_APPT|REMOTE|EPIC|EPIC|20170328193318||ACK|12345678|T|2.4|
MSA|AA|||
and I get an error saying ERROR: Message control Ids do not match.
As far as I understand this error means that the Message Control Id which is returned in the ACK message is not the same.
From what I can see, the number 12345678 is the Message Control Id, and I see that number both in the message I send as well as the in the ACK which is returned. So what is wrong here? And who is at fault? Me or the remote party?
Does anybody know how I can solve or debug this?
If you don't want to validate the message control ID, you can open the Response Validation properties and uncheck "Validate Message Control Id":
If the remote system cannot change their logic and you still want to validate the control ID, you can do that in a response transformer:
if (responseStatus == ERROR) {
// msg here is the ACK, origMsg is the encoded data that was sent outbound
var origMsg = new XML(SerializerFactory.getSerializer('HL7V2').toXML(connectorMessage.getEncodedData()));
if (origMsg.MSH['MSH.10']['MSH.10.1'].toString() == msg.MSH['MSH.10']['MSH.10.1'].toString()) {
responseStatus = SENT;
}
}
MSA.2 (Message Control ID) is required and should be the same as the ControlId in the former message that the ACK message acknowleges..
I am new to Rails. I am trying to send push notification using rpush gem.
I am following these steps:
n = Rpush::Gcm::Notification.new
n.app = Rpush::Gcm::App.find_by_name("android_app")
n.registration_ids = ["#{d.device_token}"]
n.data = { title: "#{self.title}"}
n.save!
The notification gets saved but is not getting delivered, and I get the following error description:
"Unable to deliver notification 10, received error (Failed to deliver to all recipients. Errors: NotRegistered.)"
Not able to understand the issue here. Please help me.
Thanks!
When you find above mentioned message in your log, means, as said #abielita and rpush wiki documentation, the identification_id GCM is using to send notification, is no more valid.
Device with (d.device_token) as registration token, is no more registered on GCM (Firebase) Service.
This message come for a specified reason: adapt your code to this condition.
Maybe is better destroy your "d" record !?
Becomes helpful Rpush.reflect in config/initializers/rpush.rb
Uncomment event notification on.gcm_invalid_registration_id and add your code inside block
e.g.
on.gcm_invalid_registration_id do |app, error, registration_id|
Device.where(registration_id: registration_id).take.destroy
end
and encloses your sending notification code inside a conditional check
unless(d.nil?)
n = Rpush::Gcm::Notification.new
n.app = Rpush::Gcm::App.find_by_name("android_app")
n.registration_ids = ["#{d.device_token}"]
n.data = { title: "#{self.title}"}
n.save!
end
I hope it help
Getting Mandrill_Unknown_Sender exception when searching recently sent messages.
Here are arguments that are passed to searchTimeSeries funciton. For this example, I'm using a dummy email address, but I get same error when I use a valid email address.
update: Mandrill support says that it's a bug on their end. For now, a workaround will be not to pass in the senders parameter.
The error happens due to invalid sender , in this case support#mywebsite.com . Did you send any emails from this Sender ? I saw that you put an dummy email address in query, but wanted to check if you were sending the a right address in the "senders" .
I was able to reproduce the error that you got, when I entered a wrong email address in senders input, and I got the following response:
{
"status": "error",
"code": 2,
"name": "Unknown_Sender",
"message": "No such sender \"You provided one or more Sender addresses that don't exist: abs#abs.com"
}
but when I corrected the "senders" input , the problem went away.
Hope this helps,
I've been searching Google for awhile and there seems to be no offers on fixing this problem I have here.
I am using LuaSocket as a simple way to connect to a external server I created, and I am able to connect to it successfully and send a signal.
However, when I try to send a second message later on, the external server does not seem to be receiving the message, even though I am still connected to the socket.
socket = require("socket")
host, port = ip, port
tcp = assert(socket.tcp())
tcp:settimeout( 0 )
tcp:connect(host, port);
msg = {
["status"]="connect",
["usrName"]=username
}
msg = Json.Encode(msg)
tcp:send(msg); -- This message, the server received this message.
-- Later in my code, I attempt to send another message.
msg = {
["status"]="anotherMessage",
["usrName"]=username
};
msg = Json.Encode(msg)
tcp:send(msg); -- This message is not sending, even though i'm still connected.
You need to show what happens on the other side as it may be simply not reading even though the connection may be open. You also don't say what exactly happens when "message is not sending"; do you get an error? the script finishes but the message is not sent?
There are several things you can try:
Switch to the (default) synchronous send until you get it working; remove tcp:settimeout(0), as your send may simply fail with "timeout" message if the other side is not ready to read the message.
Check the error message from :send call to see if it's timing out or not.
local ok, err = tcp:send(msg)
Use socket.select to check if the other side it ready to accept the message you are sending.
Try adding "\r\n" at the end of your serialized JSON.