activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From KateMacdonald <>
Subject NMS NetTxConnection fails to create a session when hostname includes a hyphen
Date Mon, 29 Oct 2012 17:02:52 GMT
All our local machines hostnames include a hyphen, e.g. "Machine-M1234".

This is causing an exception when I try to create a session from a
NetTxConnection as the GuidFromId() method is failing to parse the BrokerId
into a Guid because of this hyphen in the hostname; e.g.

Renaming all our machines isn't an option. Other than downloading the
source, re-implementing this method and recompiling is there anything simple
I can do to fix this issue?


private static Guid GuidFromId(string id)
	// Remove the ID: prefix, that's non-unique to be sure
	string resId = id.TrimStart("ID:".ToCharArray());

	// Remaing parts should be host-port-timestamp-instance:sequence
	string[] parts = resId.Split(":-".ToCharArray());

	// We don't use the hostname here, just the remaining bits.
	int a = Int32.Parse(parts[1]);
	short b = Int16.Parse(parts[3]);
	short c = Int16.Parse(parts[4]);
	byte[] d = System.BitConverter.GetBytes(Int64.Parse(parts[2]));

	return new Guid(a, b, c, d);

View this message in context:
Sent from the ActiveMQ - Dev mailing list archive at

View raw message