activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Murphy" <bmurphy1...@gmail.com>
Subject Re: How to create .NET dll of ActiveMQ with IKVM
Date Fri, 21 Nov 2008 22:40:51 GMT
On Thu, Nov 20, 2008 at 11:18 AM, user939393
<mike.mccormick@tideworks.com> wrote:
>
> I have and it works great.
>
> This command will create the dll that you need.
> ikvmc.exe -target:library -out:activemq-client.dll "C:\Program
> Files\Apache\apache-activemq-5.1.0\activemq-all-5.1.0.jar"
>
> Your project will also need to reference IKVM.OpenJDK.ClassLibrary.dll,
> IKVM.Runtime.dll, and JVM.dll.
>
> I have found that this performs way better than NMS and you have access to
> the full JMS API.

Unfortunately, this method is not working so great for me.  I took
ikvm v0.38.0.2, packaged the activemq 5.2.0 release jar and referenced
it in one of my test projects.  I pointed the test project at my
ActiveMQ server, ran the test code, and every time I try and start the
connection I get the following exception:

JMSException: Channel was inactive for too long: /10.0.0.98:61616
Stack Trace:
   at org.apache.activemq.ActiveMQConnection.syncSendPacket(Command command)
   at org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent()
   at org.apache.activemq.ActiveMQConnection.start()

Alas, this does not appear to be a quick fix solution for me.   For
reference, here is the code I ran to test the library (exception
thrown at connection.start()):

var factory = new
ActiveMQConnectionFactory("tcp://10.0.0.98:61616?keepAlive=true&soTimeout=30000&soTimeout=5000");

var connection = factory.createConnection();
connection.start();

var session = connection.createSession(false,
Session.__Fields.AUTO_ACKNOWLEDGE);
var destination = session.createQueue("TestQueue");

var producer = session.createProducer(destination);
producer.setDeliveryMode(DeliveryMode.__Fields.PERSISTENT);

for (int i = 0; i < 100; i++)
{
	producer.send(session.createTextMessage(Guid.NewGuid().ToString("N")));
}

producer.close();
session.close();
connection.stop();
connection.close();

Mime
View raw message