From adc21c625da4a84a475e799b750ab1fcb85bc913 Mon Sep 17 00:00:00 2001 From: Sreeram Garlapati Date: Fri, 22 Jan 2016 09:47:34 -0800 Subject: [PATCH] Fix Samples. --- .../azure/eventhubs/samples/ReceiveByDateTime.java | 3 +-- .../com/microsoft/azure/eventhubs/samples/Send.java | 13 +------------ .../azure/eventhubs/samples/SendBatch.java | 3 +-- .../com/microsoft/azure/eventhubs/lib/TestBase.java | 2 +- 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/java/samples/src/main/java/com/microsoft/azure/eventhubs/samples/ReceiveByDateTime.java b/java/samples/src/main/java/com/microsoft/azure/eventhubs/samples/ReceiveByDateTime.java index 54e7c524..54c0d0a8 100644 --- a/java/samples/src/main/java/com/microsoft/azure/eventhubs/samples/ReceiveByDateTime.java +++ b/java/samples/src/main/java/com/microsoft/azure/eventhubs/samples/ReceiveByDateTime.java @@ -17,8 +17,7 @@ public class ReceiveByDateTime public static void main(String[] args) throws ServiceBusException, ExecutionException, InterruptedException, IOException { - ConnectionStringBuilder connStr = new ConnectionStringBuilder("firstehub-ns", "gojavago", "RootManageSharedAccessKey", "LHbmplGdVC7Lo7A1RAXXDgeHSM9WHIRvZmIt7m1y5w0="); - // ConnectionStringBuilder connStr = new ConnectionStringBuilder("----namespaceName-----", "----EventHubName-----", "-----sayKeyName-----", "---SasKey----"); + ConnectionStringBuilder connStr = new ConnectionStringBuilder("----namespaceName-----", "----EventHubName-----", "-----sayKeyName-----", "---SasKey----"); EventHubClient ehClient = EventHubClient.createFromConnectionString(connStr.toString()).get(); diff --git a/java/samples/src/main/java/com/microsoft/azure/eventhubs/samples/Send.java b/java/samples/src/main/java/com/microsoft/azure/eventhubs/samples/Send.java index 3b519d4c..701de3fc 100644 --- a/java/samples/src/main/java/com/microsoft/azure/eventhubs/samples/Send.java +++ b/java/samples/src/main/java/com/microsoft/azure/eventhubs/samples/Send.java @@ -16,12 +16,7 @@ public class Send public static void main(String[] args) throws ServiceBusException, ExecutionException, InterruptedException, IOException { - String username = "RootManageSharedAccessKey"; - String password = "LHbmplGdVC7Lo7A1RAXXDgeHSM9WHIRvZmIt7m1y5w0="; - String namespaceName = "firstehub-ns"; - - ConnectionStringBuilder connStr = new ConnectionStringBuilder(namespaceName, "gojavago", username, password); - // ConnectionStringBuilder connStr = new ConnectionStringBuilder("----namespaceName-----", "----EventHubName-----", "-----sayKeyName-----", "---SasKey----"); + ConnectionStringBuilder connStr = new ConnectionStringBuilder("----namespaceName-----", "----EventHubName-----", "-----sayKeyName-----", "---SasKey----"); Gson gson = new GsonBuilder().create(); @@ -44,12 +39,6 @@ public class Send System.out.println(Instant.now() + ": Send Complete..."); System.in.read(); - - while(true){ - sender.send(sendEvent).get(); - - System.out.println(Instant.now() + ": re-Send Complete..."); - System.in.read();} } /** diff --git a/java/samples/src/main/java/com/microsoft/azure/eventhubs/samples/SendBatch.java b/java/samples/src/main/java/com/microsoft/azure/eventhubs/samples/SendBatch.java index 0c5932db..68bd4531 100644 --- a/java/samples/src/main/java/com/microsoft/azure/eventhubs/samples/SendBatch.java +++ b/java/samples/src/main/java/com/microsoft/azure/eventhubs/samples/SendBatch.java @@ -15,8 +15,7 @@ public class SendBatch public static void main(String[] args) throws ServiceBusException, ExecutionException, InterruptedException, IOException { - ConnectionStringBuilder connStr = new ConnectionStringBuilder("firstehub-ns", "gojavago", "RootManageSharedAccessKey", "LHbmplGdVC7Lo7A1RAXXDgeHSM9WHIRvZmIt7m1y5w0="); - // ConnectionStringBuilder connStr = new ConnectionStringBuilder("----namespaceName-----", "----EventHubName-----", "-----sayKeyName-----", "---SasKey----"); + ConnectionStringBuilder connStr = new ConnectionStringBuilder("----namespaceName-----", "----EventHubName-----", "-----sayKeyName-----", "---SasKey----"); Gson gson = new GsonBuilder().create(); diff --git a/java/src/test/java/com/microsoft/azure/eventhubs/lib/TestBase.java b/java/src/test/java/com/microsoft/azure/eventhubs/lib/TestBase.java index f25568d4..23416d7c 100644 --- a/java/src/test/java/com/microsoft/azure/eventhubs/lib/TestBase.java +++ b/java/src/test/java/com/microsoft/azure/eventhubs/lib/TestBase.java @@ -22,7 +22,7 @@ public abstract class TestBase public static TestEventHubInfo checkoutTestEventHub() { HashMap sasRule = new HashMap(); - sasRule.put(TestBase.SasRuleName, "LHbmplGdVC7Lo7A1RAXXDgeHSM9WHIRvZmIt7m1y5w0="); + sasRule.put(TestBase.SasRuleName, "---------SasKey-----------"); return new TestEventHubInfo("gojavago", "firstehub-ns", null, sasRule); }