This post has NOT been accepted by the mailing list yet.
This question must have been asked before but I could not find the right solution.
I wanted to post a String to the default TCP port but I am getting different kinds of exception.
Exception jvm 1 | WARN | Transport Connection to: tcp://127.0.0.1:57005 failed: java.i
o.IOException: Frame size of 1158 MB larger than max allowed 100 MB
and the piece of code that I am running to send the data is as follows: public static void main(String argv) throws Exception
Socket client = new Socket("localhost", 61616);
OutputStream outToServer = client.getOutputStream();
DataOutputStream out = new DataOutputStream(outToServer);
DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
Date todayDate = new Date();
String abc="Hello World";
byte b = abc.getBytes();
out.write(b);//(" Content gets received in server");
That code is trying to communicate with the broker without using the broker's protocol (openwire). So, the broker is really complaining that it cannot properly parse the content.
The correct way to use TCP/IP to connect to the broker is to create an ActiveMQConnectionFactory() using the tcp transport (like this for localhost: tcp://localhost:61616), and then use the ActiveMQConnection to create a session and producer, then send a message.
If you want a "raw TCP/IP" connection, then it needs some type of protocol - even if home-grown.
Perhaps you could use Camel's Mina connector to implement what you want. Otherwise, you'll likely want a service that interfaces between the m2m devices and ActiveMQ. The latter is the path I would seriously consider unless this is just for a test environment, prototype, or something else that does not need to be production-grade.
If you can get a STOMP client to run on the m2m device, perhaps that's a good alternative.
Actually, back to the original concern, is there a reason the m2m device cannot use an ActiveMQ connection?