1

I am trying to send a string to the EventHub and I have written this code:

 private static void sendPOST(ValueChangeMessage valueChangeMessage) throws IOException {
     try {
//            final String namespaceName = ""; //sericebusnamespacename
//            final String eventHubName = "";
//            final String sasKeyName = "";
//            final String sasKey = "";
//            ConnectionStringBuilder connStr = new ConnectionStringBuilder(namespaceName, eventHubName, sasKeyName, sasKey);
         byte[] payloadBytes = valueChangeMessage.data.get().toString().getBytes(StandardCharsets.UTF_8);
          
         EventData sendEvent = new EventData(payloadBytes);
                
         EventHubClient ehClient = EventHubClient.createFromConnectionStringSync(connStr.toString());
                ehClient.sendSync(sendEvent);
    
    } 
    catch (ServiceBusException ex) {
        Logger.getLogger(CatChannel.class.getName()).log(Level.SEVERE, null, ex);
    }          
}

But whenever I try to run the project from netbeans , it gives the error below:

error: cannot access Message

sendEvent = new EventData(payloadBytes);

class file for org.apache.qpid.proton.message.Message not found

Can anyone tell me what can be the possible issue??

Community
  • 1
  • 1

1 Answers1

0

I got the fix for this..........actually the issue was with the proxies of the system.....it wasnt able to download the jars from maven.....So i manually included the dependencies in my project