on 08-03-2015 12:40 PM
Hi,
I enabled the transaction failure handling (see: ).
After doing that, the error files generated by this functionality are generated in the following folder ..\Server\configuration\com.sap.mobile.platform.server.agentry.application.[SMP_APPLICATION_ID]\[FAILED_TRANSACTION_QUEUE_PARAMETER_SET_IN_SMP]
In the Agentry project I created a Service Event, type Poll, to periodically read the error files in this folder and send them to a custom backend table for further processing.
The problem is that I had to hardcode the path to the folder in my step handler in the following way:
File _Folder = new File(
ConfigManager.getFilePath("configuration\\com.sap.mobile.platform.server.agentry.application.HARDCODED_SMP_APP_ID\\FailedTransactionsQueue"));
I would like to find a way to determine what is the Agentry app executing the step handler, to dynamically specify the corresponding folder to read the files.
How can I know the SMP Application ID from the Java backend? I tried to inspect the Server and ConfigurationManager objects but I haven't been able to find this property yet.
I also don't know what code is triggered to generate this XML error files in the server. I tried to inspect Agentry-v5.jar but I'm not able to find how the log error files are generated.
Thank you in advance for your help.
Marçal
Marcal,
Probably the best way will be to use the findConfigurationFile and get the Path from that and append your directory from there.
findConfigurationFile("javaBE.ini").getPath()
You may need to reference with super.findConfigurationFile depending on where you are calling it from.
--Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Bill,
This works.
I just did a small change:
File _Folder = new File(_server.findConfigurationFile("JavaBE.ini").getParent() + "\\FailedTransactionsQueue");
Even though my question has been answered, I still have the folder name hard coded which can be changed from the SMP cockpit, but I think I can live with that. I don't see how to access to the SMP application metadata.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.