Hello Ted/Anybody,

Could you please correct me about the schema request (AM1S) which I am sending to broker to get the schema response for particular class?

Could you please let me know what is wrong here. I think schema request is not healthy. Please guide me here. I am not receiving the schema response with this schema request

Here is the code snippet of Schema request and Schema response.
// Code snippet for Schema Request (AM1S)
....

p.opcode="AM1S";
p.sequenceNo=500;
p.packageName="qpid";
p.classname="vhost";

message.clear();
try {
// encode the opcode
message.put(p.opcode.getBytes("UTF-8"));
message.putInt( p.sequenceNo);
// encode the package name
encoder.writeStr8(p.packageName);
message.putShort((byte) p.packageName.length());
message.put(p.packageName.getBytes("UTF-8"));
// encode the class name
encoder.writeStr8(p.classname);
message.putShort((byte) p.classname.length());
message.put(p.classname.getBytes("UTF-8"));
// encode the schema hash
// *** schema has contents which it got from // byte[] schemaHash=decoder.readBin128(); something like [EMAIL PROTECTED] ***

encoder.writeBin128(schemaHash);
message.put((byte) schemaHash.length);
message.put(schemaHash);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
........
........

------

//Start Code snippet Schema Response (AM1s)

String packname = decoder.readStr8();
System.out.println("Package Name: " + packname);
String clasnam = decoder.readStr8();
System.out.println("Class Name: " + clasnam);
                                
// get the decoded schema hash
decoder.readBin128();
// get the decoded properties contents
int propCnt = decoder.readUint16();
System.out.println("Property content:   " + propCnt);
long statCnt = decoder.readUint16();
System.out.println("Statistic content:   " + statCnt);
int methodCnt = decoder.readUint16();
System.out.println("Method content:   " + methodCnt);
int eventCnt = decoder.readUint16();
System.out.println("Event content:   " + eventCnt);
        
for( int i = 0; i < propCnt; i++ )
{       // decode the MAP
Map<String,Object> map = decoder.readMap();
}
                                
for( int i = 0; i < statCnt; i++ )
{
// decode the MAP
Map<String,Object> map = decoder.readMap();
}
                                
for( int i = 0; i < methodCnt; i++ )
{       // decode the MAP
Map<String,Object> map = decoder.readMap();
}
                                
for( int i = 0; i < eventCnt; i++ )
{       // decode the MAP
Map<String,Object> map = decoder.readMap();
}
---------
End of the Code

Thank you.

Best Regards,
Rahul

Reply via email to