import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
-import java.security.GeneralSecurityException;
import java.util.List;
import org.json.JSONObject;
CambriaPublisher pub = null;
try {
pub = CambriaClientFactory.createSimplePublisher(null, UEBlist, pubTopic);
- } catch (MalformedURLException e1) {
- e1.printStackTrace();
- } catch (GeneralSecurityException e1) {
- e1.printStackTrace();
+ } catch (Exception e1) {
+ logger.error("Exception Occured"+e1);
}
final JSONObject msg1 = new JSONObject ();
msg1.put ( "JSON", "UEB Update Ruest UID=" + uniqueID);
-
- try {
- pub.send ( "MyPartitionKey", msg1.toString () );
- } catch (IOException e) {
- e.printStackTrace();
- }
- pub.close ();
-
+ if(pub != null){
+ try {
+ pub.send ( "MyPartitionKey", msg1.toString () );
+ pub.close ();
+ } catch (IOException e) {
+ logger.error("Exception Occured"+e);
+ }
+ }
}
public static void createTopic (String url, String uniquID, List<String> uebURLList){
String id = "0";
try {
CConsumer = CambriaClientFactory.createConsumer ( null, uebURLList, topic + uniquID, "clientGroup", id, 15*1000, 1000 );
- } catch (MalformedURLException e1) {
- e1.printStackTrace();
- } catch (GeneralSecurityException e1) {
- e1.printStackTrace();
- }
+ } catch (Exception e1) {
+ logger.error("Exception Occured"+e1);
+ }
int count = 1;
while (count < 4) {
publishMessage(topic + "UpdateRequest", uniquID, uebURLList);