Single message stuck in transmission queue - service-broker

Ok I am using service broker all other sent through service broker work fine. Except one single message is stuck in the transmission queue and will not send. Only error message I see is:
Connection attempt failed with error: '10060(A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)'.
But it's not clear that is related. Again on other messages of same message type sent are working normally.

The issue was Service Broker not working when XML contains special
characters
The issue was that in generating xml to be sent over service broker we had an á (a-acute) in our document. We overcame this issue by switching the message type from VALIDATION =
WELL_FORMED_XML to
VALIDATION = None.
We then modified
activated stored procedure on the receiving queue. Changing the line
#message_body = CAST(message_body as XML),
-- to
#message_body = CAST(CAST(message_body AS VARCHAR(MAX)) AS XML),
This solved the issue.
I believe alternatively we could have sanitized our xml to replace the á (a-acute) with and html char code, but are use case requires us to allow the use of a lot of special characters which would be hard to id up front.
Connection attempt failed with error: '10060(A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)'.
This message was due a connection issue with another service broker instance running on the same server.

Related

Mule 3.9 logs HTTP response sending task failed with error: Locally closed

I use ApiKit to receive queries. Occasionally I get the following line in a log file:
WARN org.mule.module.http.internal.listener.grizzly.ResponseCompletionHandler - HTTP response sending task failed with error: Locally closed
It seems that in this case the integration has not sent a response to the party that called the integration. I thought that there might be a sort of timeout before ApiKit closes the connection to caller but based on timestamps that might not be the case as everything happens within a second.
In this case the payload is sent to Artemis queue before this warning and despite the warning the message is read from Artemis normally and the whole flow works otherwise just fine besides this warning and not sending the response.
So, am I correct when I think that this warning is an indication why the response is not sent? In addition to that what can be done to prevent this situation?

How to abort code when publish message on non exist queue in rabbitmq

I have wrote server-client application.
Server Side
server will initilise a queue queue1 with routing key key1 on direct exchange.
After initilise and declaration it consume data whenever someone write on it.
Client Side
client will publish some data on that exchange using routing key key1 .
Also i have set mandotory flag to true before i publish.
Problem
everything is fine when i start server first .but i got problem when i start client first and it publish data with routing key. When client published data there is no exception from broker.
Requirement
I want exception or error when i published data on non existing queue.
If you will publish messages with mandatory flag set to true, then that message will returned back in case it cannot be routed to any queue.
As to nonexistent exchanges, it is forbidden to publish messages to non-existent exchanges, so you'll have to get an error about that, something like NOT_FOUND - no exchange 'nonexistent_exchange' in vhost '/'.
You can declare exchanges an queues and bind them as you need on client side too. These operations are idempotent.
Note, that creating and binding exchanges and queues on every publish may have negative performance impact, so do that on client start, not every publish.
P.S.: if you use rabbitmq-c, then it is worth to cite basic_publish documentation
Note that at the AMQ protocol level basic.publish is an async method:
this means error conditions that occur on the broker (such as publishing to a non-existent exchange) will not be reflected in the return value of this function.
I spend a lot time to find do that. I have a example code in python using pika lib to show how to send messsage with delivery mode to prevent waiting response when send message to noneexist queue(broker will ignore meessage so that do not need receive response message)
import pika
# Open a connection to RabbitMQ on localhost using all default parameters
connection = pika.BlockingConnection()
# Open the channel
channel = connection.channel()
# Declare the queue
channel.queue_declare(queue="test", durable=True, exclusive=False, auto_delete=False)
# Enabled delivery confirmations
channel.confirm_delivery()
# Send a message
if channel.basic_publish(exchange='test',
routing_key='test',
body='Hello World!',
properties=pika.BasicProperties(content_type='text/plain',
delivery_mode=1),
mandatory=True):
print('Message was published')
else:
print('Message was returned')
Reference:
http://pika.readthedocs.org/en/latest/examples/blocking_publish_mandatory.html

Routing error - No subscribers were found. WCF-SQL Adapter

I'm attempting to call a Stored proc, get some data back, map that to the desired schema, output the result.
However, I'm getting the following error:
The Messaging engine failed to process a message submitted by
adapter:WCF-SQL Source
URL:mssql://master-biztalk//ReportServer?InboundId=batman. Details:The
published message could not be routed because no subscribers were
found. This error occurs if the subscribing orchestration or send port
has not been enlisted, or if some of the message properties necessary
for subscription evaluation have not been promoted. Please use the
Biztalk Administration console to troubleshoot this failure.
I'm not quite certain why I'm getting this error. Searching the web hasn't enlightened me any further. Following are some of the steps I've undertaken
Consume adapter = generated schema.
Map this schema to desired output.
Receive port in the Orchestration which connects to a receive message which has the Schema generated by the consume adapter as the type.
Added a receive port in Biztalk, configured WCF-SQL and setup bindings. (Typed polling)
Linked this receive port to the logical receive port in orchestration.
I haven't promoted any elements in messages.
Thanks for the help
EDIT: I updated the pipeline to XML, and now I'm getting the following error:
There was a failure executing the receive pipeline:
"Microsoft.BizTalk.DefaultPipelines.XMLReceive,
Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" Source: "XML disassembler" Receive
Port: "DatabaseReceiveport" URI:
"mssql://master-biztalk//ReportServer?InboundId=batman" Reason:
Finding the document specification by message type
"http://schemas.microsoft.com/Sql/2008/05/TypedPolling/batman#TypedPolling"
failed. Verify the schema deployed properly.
I'm not quite sure what it's trying to do above.
This means that either:
The Project/Assembly with the specified Schema has not been deployed.
The WCF SQL configuration is off somehow, frequently the InBoundId parameter. That's where "batman" would come from.
In the All Artifacts Application, check the Schemas folder for that Schema by Root Node and Namespace.

FIX Protocol 4.4 Connection not responding to Login

To anyone who can help,
I am having a show stopping issue connecting to the test server.
My TCP/IP connection is established via:
Socket _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
I send the connection message to the server via:
_socket.Send(_txData);
where _txData is a byte[] _txData array initialized with the connection request message:
8=FIX.4.4\0019=121\00135=A\00149=NotRealSenderID\0 0156=NotRealTargetID\00134=1\00152=20140522-20:12:04.392\00198=0\001108=30\001554=NotRealPassw ord\00110=017\001 converted to a byte array.
I wait for the login success message via:
int responseCount = _socket.Receive(_rxBuffer);
but after a few seconds, the _socket.Receive unblocks and returns zero bytes suggesting unsuccessful connection.
What am I doing wrong?
Is my login message at fault? Is it the way I establish server connection? I am at a loss!
Currently, My default Windows 7 Firewall is disabled, and I attempted to telnet into the server, and the image below snapshots the outcome:
Any help will be appreciated, as this is a major show stopper for me.
Thanks.
I managed to resolve this issue. The problem was with the SOH character in my message.
I was using the literal SOH = "\001" converted to a byte, when I should have done this: SOH = (char) 0x1; DUH!!
For the record, I used the following tools to 'debug' this issue:
Wireshark with display filter and capture filter set to the host server's ip address, and MINI-FIX to generate and transmit FIX messages to the host server.
I then compared the output from my client to those produced by MINI-FIX via Wireshark. It didn't take me long to spot the error from there.
What is "the test server" ?
Can you ping it ?
From the look of that telnet session you haven't permission to make a connection, or there is nothing running at the destination.

Creating failed message on WCF-CustomIsolated Receive Location

I have a receive port with a WCF-CustomIsolated receive location.
On receive port I checked "Enable routing for failed messages".
In pipeline settings I have set ValidateDocument to true.
When a client sends me an incorrect schema, it receives a validation error (that happened in pipeline) and it's OK.
But it's not routed as a fault message to message box.
Could you help me why does it happen?
Why "routing for failed messages" does not work in this case? And in what cases it should work?
Thank you!
On the Receive Location, go the Transport Properties, Messages, Error Handling, and check Suspend request message on failure.
Even though it says "Suspend" checking this in combination with the Routing for Failed Message on the Receive Port will actually create a FailedMessage that you are after. (If Routing for Failed Message isn't enabled it will suspend).
This applies to all the WCF adapters, not just the CustomIsolated one.
You need to subscribe to the error message. You could use a send port or orchestration with a filter set to the receive port, message type and/or message error.