())); } @Scheduled (Cron= "0 28 11?" * *" )//use the Cron property to execute at a specified time, which in this case is 11:28 execution; Cron is a scheduled task under Unix and Unix-like systems (such as Linux) Public voidfixtimeexecution () {System.out.println ("At specified time" + Dateformat.format (NewDate ()) + "? Execution"); }}2GT; Configuration class Package Com.wisely.highlight_spring4.ch3.taskscheduler; Import Org.springframework.context.annotation.ComponentScan; Import org.sp
1: It is easy to read the configuration of the custom properties in the Application.properties, so there are not too many descriptions here:Custom properties and loadingFor example, define the following properties:
com.blog.title=spring Boot Tutorial
The corresponding configuration properties are then loaded by @Value ("${Property Name}") annotations, as follows
Jedisconnectionfactory ();
}
@Bean public
redistemplate
After the configuration is completed, write the test case experiment effect@RunWith (Springjunit4classrunner.class)
@SpringApplicationConfiguration (application.class) Public
class applicationtests {
@Autowired
private redistemplate Of course the data operations provided in Spring-data-redis are much more than this, this article is only used as a configuration reference w
server.port=8082
server.address=127.0.0.1
# server.sessiontimeout=30
#访问路径名称
server.contextpath=/boot
Create a new Test.controller package and create a new Web class:
/**
* @Package: Com.springboot.test.controller
* @ClassName:
Test * @Description: Testing Web
* @Author Shuyu.wang
* @Date 2017-12-07 10:05
**/
@RestController public
class TestController {
@ Requestmapping (value = "/hello", method = requestmethod.get) public
String Hell
The article realizes the separation of one master and two from the following: Engineering catalogue
First POM file
Dependency> groupId>org.springframework.bootgroupId> Artifactid>spring-boot-starter-webArtifactid> Exclusions> exclusion> groupId>org.springframework.bootgroupId> Artifactid>spring-boot-starter-loggingAr
--- [ restartedMain] com.ysl.jna.jna.JnaApplicationKt : Started JnaApplicationKt in 7.447 seconds (JVM running for 8.208)Indicates that your app has started successfully; the second-to-last line of debugging information is as follows:2017-12-23 13:30:39.642 INFO 6788 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ‘‘You will see spring
to be monitored to joinCreate a spring boot app to monitorThe following dependencies are added to the Pom.xml?
12345
dependency > NBSP; groupid >de.codecentric groupid > NBSP; artifactid >spring-boot-admin-starter-client artifactid > NBSP; version >1.5.7 version > dependency >
=9200 It is this configuration by default, no special requirements, no modifications are required locally.Start Elasticsearch./bin/elasticsearch Launch success, access to localhost:9200, Web page display:{ "name": "56IrTCM", "cluster_name": "Elasticsearch", "Cluster_uuid": "E4ja7vs2tiki1bsggeaa6q", " Version ": { " number ":" 5.2.2 ", " Build_hash ":" F9d9b74 ", " build_date ":" 2017-02-24t17:26:45.835z ", "Build_snapshot": false, "lucene_version": "6.4.1" }, "tagline": "Y
pk1640-Dragon Fruit Spring Boot Tutorial CompleteDocking real data from 0 development front-end separation Enterprise-class online projectThe beginning of the new year, learning to be early, drip records, learning is progress!Essay background: In a lot of times, many of the early friends will ask me: I am from other languages transferred to the development of the
The Druid is the best database connection pool in the Java language and provides powerful monitoring and scaling capabilities. the industry compared Druid and HIKARICP, although HIKARICP performance is higher than Druid, but because Druid includes many dimensions of statistical and analytical functions, so this is why everyone chooses to use it. The following describes how to configure using Druid in Springboot 1: Modify the Pom file to add dependencies:
2: Add the appropriate data sourc
7. Configure upload and downloadUsing the upload download feature we need to configure the Multipartresolver, start the project first, do not configure. Access Endpoint /beans:Spring boot instantiates a multipartresolver (standardservletmultipartresolver) by defaultTo cancel, configure: Spring.servlet.multipart.enabled=falseConfiguration items for Standardservletmultipartresolver:Standardservletmultipartresolver is based on the Servlet3.0. Do not wan
Configuring, starting KibanaTo Kibana's installation directory: The default configuration is sufficient.Visit localhost:5601, Web page display:Proof of successful start-up.Create a Springboot ProjectThe starting dependency is as follows: log4j configuration,/src/resources/log4j.properties as follows:log4j.rootlogger=info,console# for package Com.demo.elk, log would is sent to socket appender.log4j.logger.com.forezp= DEBUG, socket# Appender socketlog4j.appender.socket=org.apache.log4j.net.socke
, adhere to the principle of diversification, choose a better and more economical way, rather than top-down unification. More commonly, we can directly use MongoDB to store key value pairs of data types, such as: Verification Code, session, etc. due to MongoDB's scale-out capability, it can also be used to store data that is very large in the future, such as: logs, comments, etc. Because MongoDB stores the weak type of data, it can also be used to store some changeable JSON data, such as: the in
-19t05:37:44-07:00 [INFO] Final memory:19m/48m [INFO] ———————————————————————— The image was built successfully. To view the image:docker imagesShow:Forezp/springboot-with-docker latest 60fdb5c61692 about a minute ago 195 MB Boot Image:$ docker run-p 8080:8080-t Forezp/springboot-with-docker Open browser to access localhost:8080; Browser display: Hello Docker world.Illustrates that Docker's Springboot project has been deployed.To stop mirroring:Doc
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.