Graham Walsh
2010-07-16 14:41:07 UTC
Hi,
I'm trying to put in place a multi profile IOR, such that when server1
is down, clients automatically route to server2 specified in profile
#2 in the IOR.
In my server, I do the following (pseudo code)
// assume obj1 exists and is the reference for "this" server.
std::string corbaLocString = "corbaloc:iiop:***@HOSTNAME2:16456/";
std::string poaID = // the id of the POA under which the servant is
registered
corbaLocString+=poaID;
corbaLocString+=objectIdOfObjectAsString;
// object ref for second/backup server
CORBA::Object_var obj2 = getORB()-
("IORManipulation");
TAO_IOP::TAO_IOR_Manipulation_var iorm =
TAO_IOP::TAO_IOR_Manipulation::_narrow (IORM.in ());
CORBA::Object_var merged = iorm->add_profiles(obj1, obj2);
Now looking at the output of tao_catior -f server.ior , I can see that
the object Id's are not identical (see below)
....NUP...#........RootPOA.IOBSSessionManager.........IOBSSessionManager-
singleton
versus
....NUP...#........RootPOA.IOBSSessionManager.IOBSSessionManager-
singleton
When I take down the first server , the client gets an
OBJECT_NOT_EXIST back from the second server (it connects to it ok,
just the object cannot be
found).
Decoding an IOR:
The Byte Order: Little Endian
The Type Id: "IDL:bnpparibas.com/synapse/obs/IOBSSessionManager:
1.0"
Number of Profiles in IOR: 2
Profile number: 1
IIOP Version: 1.2
Host Name: 1.2.3.4
Port Number: 16281
Object Key len: 82
Object Key as hex:
14 01 0f 00 4e 55 50 00 00 00 23 03 00 00 00 01
00 00 00 52 6f 6f 74 50 4f 41 00 49 4f 42 53 53
65 73 73 69 6f 6e 4d 61 6e 61 67 65 72 00 00 00
00 00 01 00 00 00 49 4f 42 53 53 65 73 73 69 6f
6e 4d 61 6e 61 67 65 72 2d 73 69 6e 67 6c 65 74
6f 6e
The Object Key as string:
....NUP...#........RootPOA.IOBSSessionManager.........IOBSSessionManager-
singleton
The component <1> ID is 0 (TAG_ORB_TYPE)
ORB Type: 0x54414f00 (TAO)
The component <2> ID is 1 (TAG_CODE_SETS)
Component length: 24
Component byte order: Little Endian
Native CodeSet for char: Hex - 10001 Description -
ISO8859_1
Number of CCS for char 1
Conversion Codesets for char are:
1) Hex - 5010001 Description - UTF-8
Native CodeSet for wchar: Hex - 10109 Description - UTF-16
Number of CCS for wchar 0
Profile number: 2
IIOP Version: 1.2
Host Name: HOSTNAME2
Port Number: 16456
Object Key len: 74
Object Key as hex:
14 01 0f 00 4e 55 50 00 00 00 23 03 00 00 00 01
00 00 00 52 6f 6f 74 50 4f 41 00 49 4f 42 53 53
65 73 73 69 6f 6e 4d 61 6e 61 67 65 72 00 49 4f
42 53 53 65 73 73 69 6f 6e 4d 61 6e 61 67 65 72
2d 73 69 6e 67 6c 65 74 6f 6e
The Object Key as string:
....NUP...#........RootPOA.IOBSSessionManager.IOBSSessionManager-
singleton
catior returned true
Curiously, if when creating my CORBA::Object using corbaloc, I insert
the missing hex characters "00 00 00 00 00 01 00 00 00" , everything
works just
fine.
If its important, I have fixed ports/endpoints configured on my
servers.
Could anybody give me some insight so I can get the second profile
running ok. (the POA is not using SYSTEM_ID for its objectId's, for
info).
thanks and have a nice weekend,
GrahamO
I'm trying to put in place a multi profile IOR, such that when server1
is down, clients automatically route to server2 specified in profile
#2 in the IOR.
In my server, I do the following (pseudo code)
// assume obj1 exists and is the reference for "this" server.
std::string corbaLocString = "corbaloc:iiop:***@HOSTNAME2:16456/";
std::string poaID = // the id of the POA under which the servant is
registered
corbaLocString+=poaID;
corbaLocString+=objectIdOfObjectAsString;
// object ref for second/backup server
CORBA::Object_var obj2 = getORB()-
string_to_object(corbaLocString.c_str());
CORBA::Object_var IORM = orb->resolve_initial_references("IORManipulation");
TAO_IOP::TAO_IOR_Manipulation_var iorm =
TAO_IOP::TAO_IOR_Manipulation::_narrow (IORM.in ());
CORBA::Object_var merged = iorm->add_profiles(obj1, obj2);
Now looking at the output of tao_catior -f server.ior , I can see that
the object Id's are not identical (see below)
....NUP...#........RootPOA.IOBSSessionManager.........IOBSSessionManager-
singleton
versus
....NUP...#........RootPOA.IOBSSessionManager.IOBSSessionManager-
singleton
When I take down the first server , the client gets an
OBJECT_NOT_EXIST back from the second server (it connects to it ok,
just the object cannot be
found).
Decoding an IOR:
The Byte Order: Little Endian
The Type Id: "IDL:bnpparibas.com/synapse/obs/IOBSSessionManager:
1.0"
Number of Profiles in IOR: 2
Profile number: 1
IIOP Version: 1.2
Host Name: 1.2.3.4
Port Number: 16281
Object Key len: 82
Object Key as hex:
14 01 0f 00 4e 55 50 00 00 00 23 03 00 00 00 01
00 00 00 52 6f 6f 74 50 4f 41 00 49 4f 42 53 53
65 73 73 69 6f 6e 4d 61 6e 61 67 65 72 00 00 00
00 00 01 00 00 00 49 4f 42 53 53 65 73 73 69 6f
6e 4d 61 6e 61 67 65 72 2d 73 69 6e 67 6c 65 74
6f 6e
The Object Key as string:
....NUP...#........RootPOA.IOBSSessionManager.........IOBSSessionManager-
singleton
The component <1> ID is 0 (TAG_ORB_TYPE)
ORB Type: 0x54414f00 (TAO)
The component <2> ID is 1 (TAG_CODE_SETS)
Component length: 24
Component byte order: Little Endian
Native CodeSet for char: Hex - 10001 Description -
ISO8859_1
Number of CCS for char 1
Conversion Codesets for char are:
1) Hex - 5010001 Description - UTF-8
Native CodeSet for wchar: Hex - 10109 Description - UTF-16
Number of CCS for wchar 0
Profile number: 2
IIOP Version: 1.2
Host Name: HOSTNAME2
Port Number: 16456
Object Key len: 74
Object Key as hex:
14 01 0f 00 4e 55 50 00 00 00 23 03 00 00 00 01
00 00 00 52 6f 6f 74 50 4f 41 00 49 4f 42 53 53
65 73 73 69 6f 6e 4d 61 6e 61 67 65 72 00 49 4f
42 53 53 65 73 73 69 6f 6e 4d 61 6e 61 67 65 72
2d 73 69 6e 67 6c 65 74 6f 6e
The Object Key as string:
....NUP...#........RootPOA.IOBSSessionManager.IOBSSessionManager-
singleton
catior returned true
Curiously, if when creating my CORBA::Object using corbaloc, I insert
the missing hex characters "00 00 00 00 00 01 00 00 00" , everything
works just
fine.
If its important, I have fixed ports/endpoints configured on my
servers.
Could anybody give me some insight so I can get the second profile
running ok. (the POA is not using SYSTEM_ID for its objectId's, for
info).
thanks and have a nice weekend,
GrahamO