use of org.neo4j.kernel.configuration.BoltConnector in project neo4j by neo4j.
the class BoltIT method startServerWithBoltEnabled.
private void startServerWithBoltEnabled(String advertisedHost, int advertisedPort, String listenHost, int listenPort) throws IOException {
server = server().withProperty(new BoltConnector("bolt").type.name(), "BOLT").withProperty(new BoltConnector("bolt").enabled.name(), "true").withProperty(new BoltConnector("bolt").encryption_level.name(), "REQUIRED").withProperty(new BoltConnector("bolt").advertised_address.name(), advertisedHost + ":" + advertisedPort).withProperty(new BoltConnector("bolt").listen_address.name(), listenHost + ":" + listenPort).usingDataDir(tmpDir.getRoot().getAbsolutePath()).build();
server.start();
}
use of org.neo4j.kernel.configuration.BoltConnector in project neo4j by neo4j.
the class CausalClusterConfigurationValidatorTest method validateSuccess.
@Test
public void validateSuccess() throws Exception {
// when
Config config = Config.embeddedDefaults(stringMap(ClusterSettings.mode.name(), mode.name(), initial_discovery_members.name(), "localhost:99,remotehost:2", new BoltConnector("bolt").enabled.name(), "true"), Collections.singleton(new CausalClusterConfigurationValidator()));
// then
assertEquals(asList(new AdvertisedSocketAddress("localhost", 99), new AdvertisedSocketAddress("remotehost", 2)), config.get(initial_discovery_members));
}
use of org.neo4j.kernel.configuration.BoltConnector in project neo4j by neo4j.
the class HazelcastClientTest method config.
private Config config() {
Config defaults = Config.defaults();
HashMap<String, String> settings = new HashMap<>();
settings.put(new BoltConnector("bolt").type.name(), "BOLT");
settings.put(new BoltConnector("bolt").enabled.name(), "true");
settings.put(new BoltConnector("bolt").advertised_address.name(), "bolt:3001");
settings.put(new BoltConnector("http").type.name(), "HTTP");
settings.put(new BoltConnector("http").enabled.name(), "true");
settings.put(new BoltConnector("http").advertised_address.name(), "http:3001");
return defaults.augment(settings);
}
use of org.neo4j.kernel.configuration.BoltConnector in project neo4j by neo4j.
the class HazelcastClusterTopologyTest method shouldCollectMembersAsAMap.
@Test
public void shouldCollectMembersAsAMap() throws Exception {
// given
Set<Member> hazelcastMembers = new HashSet<>();
List<MemberId> coreMembers = new ArrayList<>();
for (int i = 0; i < 5; i++) {
MemberId memberId = new MemberId(UUID.randomUUID());
coreMembers.add(memberId);
Config config = Config.defaults();
HashMap<String, String> settings = new HashMap<>();
settings.put(CausalClusteringSettings.transaction_advertised_address.name(), "tx:" + (i + 1));
settings.put(CausalClusteringSettings.raft_advertised_address.name(), "raft:" + (i + 1));
settings.put(new BoltConnector("bolt").type.name(), "BOLT");
settings.put(new BoltConnector("bolt").enabled.name(), "true");
settings.put(new BoltConnector("bolt").advertised_address.name(), "bolt:" + (i + 1));
settings.put(new BoltConnector("http").type.name(), "HTTP");
settings.put(new BoltConnector("http").enabled.name(), "true");
settings.put(new BoltConnector("http").advertised_address.name(), "http:" + (i + 1));
config.augment(settings);
Map<String, Object> attributes = buildMemberAttributesForCore(memberId, config).getAttributes();
hazelcastMembers.add(new MemberImpl(new Address("localhost", i), null, attributes, false));
}
// when
Map<MemberId, CoreServerInfo> coreMemberMap = toCoreMemberMap(hazelcastMembers, NullLog.getInstance(), hzInstance);
// then
for (int i = 0; i < 5; i++) {
CoreServerInfo coreServerInfo = coreMemberMap.get(coreMembers.get(i));
assertEquals(new AdvertisedSocketAddress("tx", i + 1), coreServerInfo.getCatchupServer());
assertEquals(new AdvertisedSocketAddress("raft", i + 1), coreServerInfo.getRaftServer());
assertEquals(new AdvertisedSocketAddress("bolt", i + 1), coreServerInfo.connectors().boltAddress());
assertEquals(coreServerInfo.groups(), GROUPS);
}
}
use of org.neo4j.kernel.configuration.BoltConnector in project neo4j by neo4j.
the class BoltMetricsIT method shouldMonitorBolt.
@Test
public void shouldMonitorBolt() throws Throwable {
// Given
File metricsFolder = tmpDir.newFolder("metrics");
db = (GraphDatabaseAPI) new TestGraphDatabaseFactory().newImpermanentDatabaseBuilder().setConfig(new BoltConnector("bolt").type, "BOLT").setConfig(new BoltConnector("bolt").enabled, "true").setConfig(GraphDatabaseSettings.auth_enabled, "false").setConfig(MetricsSettings.boltMessagesEnabled, "true").setConfig(MetricsSettings.csvEnabled, "true").setConfig(MetricsSettings.csvInterval, "100ms").setConfig(MetricsSettings.csvPath, metricsFolder.getAbsolutePath()).newGraphDatabase();
// When
conn = new SocketConnection().connect(new HostnamePort("localhost", 7687)).send(acceptedVersions(1, 0, 0, 0)).send(chunk(InitMessage.init("TestClient", map("scheme", "basic", "principal", "neo4j", "credentials", "neo4j"))));
// Then
assertEventually("session shows up as started", () -> readLongValue(metricsCsv(metricsFolder, SESSIONS_STARTED)), equalTo(1L), 5, SECONDS);
assertEventually("init request shows up as received", () -> readLongValue(metricsCsv(metricsFolder, MESSAGES_RECIEVED)), equalTo(1L), 5, SECONDS);
assertEventually("init request shows up as started", () -> readLongValue(metricsCsv(metricsFolder, MESSAGES_STARTED)), equalTo(1L), 5, SECONDS);
assertEventually("init request shows up as done", () -> readLongValue(metricsCsv(metricsFolder, MESSAGES_DONE)), equalTo(1L), 5, SECONDS);
assertEventually("queue time shows up", () -> readLongValue(metricsCsv(metricsFolder, TOTAL_QUEUE_TIME)), greaterThanOrEqualTo(0L), 5, SECONDS);
assertEventually("processing time shows up", () -> readLongValue(metricsCsv(metricsFolder, TOTAL_PROCESSING_TIME)), greaterThanOrEqualTo(0L), 5, SECONDS);
}
Aggregations