Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add guide on configuring port and hostname #20

Closed
harryge00 opened this issue Sep 10, 2020 · 6 comments
Closed

Add guide on configuring port and hostname #20

harryge00 opened this issue Sep 10, 2020 · 6 comments
Assignees

Comments

@harryge00
Copy link

harryge00 commented Sep 10, 2020

I am not familiar with spring framework. I tried to use setHostname/setPort or RedisStandaloneConfiguration to configure host/port, but it always reported error ...
I think as guide for spring, it will be beneficial adding example on configuring host/port instead of using the default config. Thanks

@harryge00 harryge00 changed the title How to configure port and hostname? Add guide on configuring port and hostname Sep 10, 2020
@Buzzardo
Copy link
Contributor

I think we shouldn't change the heading, but I also think it's a reasonable request to add how to set the host and port. Thanks for the feedback, @harryge00

Gary: If you're not the right person to describe that, please let me know. Also, if you want help with the wording, please let me know. I'll review it anyway, though. Thanks much.

@garyrussell
Copy link

garyrussell commented Sep 10, 2020

I am not the right person (@mp911de , or someone from the Boot team?).

However, I would suggest a doc link to https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-redis and to https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-application-properties.html#data-properties (scroll down to spring.redis.host).

I have an open request to make the anchors for those properties more granular. It's not getting much love. Vote it up!!

@dsyer
Copy link
Contributor

dsyer commented Sep 10, 2020

+1 for a doc link. And the same for rabbit and Kafka guides.

@harryge00
Copy link
Author

I finally figured out a way to configure 😂:

       # Add another function:
       @Bean
	public RedisConnectionFactory redisConnectionFactory() {
		RedisStandaloneConfiguration redisConfig = new RedisStandaloneConfiguration("1.2.3.4", 6379);
		redisConfig.setPassword(RedisPassword.of("somepassword"));
		return new LettuceConnectionFactory(redisConfig);
	}

Using application.properties would be more elegant though. Thanks for your reply.

@mp911de
Copy link

mp911de commented Sep 15, 2020

RedisConnectionFactory is configured by Spring Boot, so +1 to add a link to the Boot docs that explain Redis properties related to the endpoint configuration.

@Buzzardo
Copy link
Contributor

I added #26 to replace this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants