- publishMessage(topic+ uniquID , uniquID, uebURLList);
-
- }
- public static void start(String url, List<String> uebURLList,
- String uniqueID) {
- ManualClientEndUEB.uebURLList = uebURLList;
- ManualClientEndUEB.url = url;
- ManualClientEndUEB.uniquID = uniqueID;
- URL aURL;
- try {
- aURL = new URL(url);
- ManualClientEndUEB.topic = aURL.getHost() + aURL.getPort();
- } catch (MalformedURLException e) {
- ManualClientEndUEB.topic = url.replace("[:/]", "");
- }
- String id = "0";
- try {
- CConsumer = CambriaClientFactory.createConsumer ( null, uebURLList, topic + uniquID, "clientGroup", id, 15*1000, 1000 );
- } catch (Exception e1) {
- logger.error("Exception Occured"+e1);
- }
- int count = 1;
- while (count < 4) {
- publishMessage(topic + "UpdateRequest", uniquID, uebURLList);
- try {
- for ( String msg : CConsumer.fetch () )
- {
-
- logger.debug("Manual Notification Recieved Message " + msg + " from UEB cluster : " + uebURLList.toString());
- resultJson = msg;
- if (!msg.contains("UEB Update")){
-// System.out.println("Manual Notification Recieved Message " + msg + " from UEB cluster : " + uebURLList.toString());
- notification = NotificationUnMarshal.notificationJSON(msg);
- count = 4;
- }
- }
- }catch (Exception e) {
-
- }
- count++;
- }
- }
-
+ private static boolean publishMessageAndSetNotification(List<String> uebURLList) {
+ publishMessage(topic + "UpdateRequest", uniquID, uebURLList);
+ try {
+ for ( String msg : CConsumer.fetch () ) {
+ logger.debug("Manual Notification Recieved Message " + msg + " from UEB cluster : " + uebURLList.toString());
+ resultJson = msg;
+ if (!msg.contains("UEB Update")){
+ notification = NotificationUnMarshal.notificationJSON(msg);
+ return true;
+ }
+ }
+ }catch (Exception e) {
+ logger.error("Error in Manual CLient UEB notification ", e);
+ }
+ return false;
+ }