Skip to content

Commit 21eee7c

Browse files
committed
Few more words
1 parent d02c7c2 commit 21eee7c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/modules/ROOT/pages/hazelcast-embedded-springboot.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,17 @@ Hazelcast configuration (`hazelcast.yaml`) is placed in the `src/main/resources/
3636
include::ROOT:example$hazelcast-embedded-springboot/src/main/java/guides/hazelcast/springboot/HazelcastApplication.java[tag=imap-bean]
3737
----
3838

39+
Bean will have name "map" and can be autowired by `IMap` type (if it's the only IMap added as bean).
40+
3941
Now you can autowire the `IMap` bean in the `CommandController` and use it to access the Hazelcast structure:
4042

4143
[source,java,indent=0]
4244
----
4345
include::ROOT:example$hazelcast-embedded-springboot/src/main/java/guides/hazelcast/springboot/CommandController.java[]
4446
----
4547

48+
Please notice, that we've used `@Qualifier("map")` - it's strictly speaking optional, but once you add more IMaps, you will need to distinguish which map you want to autowire.
49+
4650
== Run the Sample Application
4751

4852
Run the application using Maven in a terminal:
@@ -56,6 +60,8 @@ Then, rerun the application in another terminal.
5660

5761
NOTE: Notice the different value for the `server.port` argument.
5862

63+
NOTE: We've used `-Djava.net.preferIPv4Stack=true`, because on some platforms there are problems with multicast on IPv6. Adding this option ensures smooth run when learning.
64+
5965
[source,bash]
6066
----
6167
mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Dserver.port=8081 -Djava.net.preferIPv4Stack=true"

0 commit comments

Comments
 (0)