Tuesday, March 14, 2023

Command to run zookeeper and kafka

Download Kafka binary file  then extract then go to kafka root folder and open the terminal in macbook.Then run below commands:


manojrajput@Manojs-MacBook-Pro kafka_2.13-3.4.0 % ~/kafka_2.13-3.4.0/bin/zookeeper-server-start.sh ~/kafka_2.13-3.4.0/config/zookeeper.properties
 

manojrajput@Manojs-MacBook-Pro kafka_2.13-3.4.0 % sh bin/kafka-server-start.sh config/server.properties



Friday, March 10, 2023

Adding Lombok in STS IDE

Using install new software, you can install any plugin.

STS--> help--> install new software


https://projectlombok.org/p2

enter image description here

Sunday, March 5, 2023

Can I use two server simulatneously in Spring boot project?

 Yes, it is possible to use two servers simultaneously in a Spring Boot project. Spring Boot is a flexible framework that supports multiple deployment options and server configurations.

One common approach is to use an application server, such as Tomcat or Jetty, as the primary server for your Spring Boot project. This server will handle incoming HTTP requests and provide a container for your application to run in.

However, you can also use additional servers for specific purposes. For example, you might use a separate server for handling WebSocket connections or for serving static assets like images or videos. In this case, you would typically configure your Spring Boot application to use both servers in parallel.

To use two servers in a Spring Boot project, you will need to configure your application appropriately. You can do this by adding dependencies for the additional servers to your pom.xml or build.gradle file, and then configuring the servers in your Spring Boot application configuration files.

It's worth noting that using multiple servers can add complexity to your application, so it's important to ensure that you have a good understanding of the various components and how they interact. Additionally, be sure to test your application thoroughly to ensure that everything is working as expected.

Saturday, March 4, 2023

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured

To resolve : 

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured



Just add 
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class }) works for me.

I was getting same error I tried with @EnableAutoConfiguration(exclude=...) didn't work.

For those that are wondering where to add @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class }), as it has been asked by user as well. You need to add it to the main Application class which is under src>main>java. By default it is set to @SpringBootApplication

 

Guitar Chords

click on   Guitar Chords Family