You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/11/11 08:34:03 UTC

[GitHub] [shardingsphere-elasticjob] gzdzss opened a new pull request #1708: Update documents and examples of Spring Boot Starter

gzdzss opened a new pull request #1708:
URL: https://github.com/apache/shardingsphere-elasticjob/pull/1708


   For #1706 .
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] TeslaCN commented on pull request #1708: Update documents and examples of Spring Boot Starter

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on pull request #1708:
URL: https://github.com/apache/shardingsphere-elasticjob/pull/1708#issuecomment-725297760


   CI failed because of
   ```
   Error:  Failed to execute goal on project elasticjob-lite-spring-boot-starter: Could not resolve dependencies for project org.apache.shardingsphere.elasticjob:elasticjob-lite-spring-boot-starter:jar:3.0.0-RC1-SNAPSHOT: Could not transfer artifact org.springframework:spring-context:jar:5.2.7.RELEASE from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/org/springframework/spring-context/5.2.7.RELEASE/spring-context-5.2.7.RELEASE.jar: Connection reset -> [Help 1]
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] gzdzss commented on pull request #1708: Update documents and examples of Spring Boot Starter

Posted by GitBox <gi...@apache.org>.
gzdzss commented on pull request #1708:
URL: https://github.com/apache/shardingsphere-elasticjob/pull/1708#issuecomment-725303313


   The spring-namespace has also been supplemented


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] TeslaCN commented on a change in pull request #1708: Update documents and examples of Spring Boot Starter

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on a change in pull request #1708:
URL: https://github.com/apache/shardingsphere-elasticjob/pull/1708#discussion_r521201164



##########
File path: docs/content/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter.en.md
##########
@@ -76,26 +76,39 @@ When to execute OneOffJob is up to you.
 Developers can inject the `OneOffJobBootstrap` bean into where they plan to invoke.
 Trigger the job by invoking `execute()` method manually.
 
-**About @DependsOn Annotation**
-
-JobBootstraps are created by the Starter dynamically. It's unable to inject the `JobBootstrap` beans if the beans which depends on `JobBootstrap` were instantiated earlier than the instantiation of `JobBootstrap`.
-
-Developers can also retrieve `JobBootstrap` beans by ApplicationContext.
-
 The bean name of `OneOffJobBootstrap` is specified by property "jobBootstrapBeanName",
 Please refer to [Spring Boot Starter Configuration](/en/user-manual/elasticjob-lite/configuration/spring-boot-starter).
 
+```yaml
+elasticjob:
+  jobs:
+    myOneOffJob:
+      jobBootstrapBeanName: myOneOffJobBean
+      ....
+```
+
 ```java
 @RestController
-@DependsOn("ElasticJobLiteAutoConfiguration")
 public class OneOffJobController {
-    
-    @Resource(name = "manualScriptJobOneOffJobBootstrap")
-    private OneOffJobBootstrap manualScriptJob;
+
+    // Through "@Resource" injection
+    @Resource(name = "myOneOffJobBean")
+    private OneOffJobBootstrap myOneOffJob;
     
     @GetMapping("/execute")
     public String executeOneOffJob() {
-        manualScriptJob.execute();
+        myOneOffJob.execute();
+        return "{\"msg\":\"OK\"}";
+    }
+
+    // Through "@Autowired" injection

Review comment:
       ```suggestion
       // Inject via "@Autowired"
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] codecov-io commented on pull request #1708: Update documents and examples of Spring Boot Starter

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #1708:
URL: https://github.com/apache/shardingsphere-elasticjob/pull/1708#issuecomment-725319354


   # [Codecov](https://codecov.io/gh/apache/shardingsphere-elasticjob/pull/1708?src=pr&el=h1) Report
   > Merging [#1708](https://codecov.io/gh/apache/shardingsphere-elasticjob/pull/1708?src=pr&el=desc) (586fbc1) into [master](https://codecov.io/gh/apache/shardingsphere-elasticjob/commit/b21485497746011fd1c4b2fc3d35d0972af82d42?el=desc) (b214854) will **decrease** coverage by `0.10%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere-elasticjob/pull/1708/graphs/tree.svg?width=650&height=150&src=pr&token=8ZMVc4Yo4Z)](https://codecov.io/gh/apache/shardingsphere-elasticjob/pull/1708?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1708      +/-   ##
   ============================================
   - Coverage     86.07%   85.97%   -0.11%     
     Complexity      106      106              
   ============================================
     Files           252      252              
     Lines          5682     5682              
     Branches        878      878              
   ============================================
   - Hits           4891     4885       -6     
   - Misses          477      482       +5     
   - Partials        314      315       +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere-elasticjob/pull/1708?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [...ticjob/lite/internal/snapshot/SnapshotService.java](https://codecov.io/gh/apache/shardingsphere-elasticjob/pull/1708/diff?src=pr&el=tree#diff-ZWxhc3RpY2pvYi1saXRlL2VsYXN0aWNqb2ItbGl0ZS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9lbGFzdGljam9iL2xpdGUvaW50ZXJuYWwvc25hcHNob3QvU25hcHNob3RTZXJ2aWNlLmphdmE=) | `77.77% <0.00%> (-4.77%)` | `1.00% <0.00%> (ø%)` | |
   | [...e/shardingsphere/elasticjob/infra/env/IpUtils.java](https://codecov.io/gh/apache/shardingsphere-elasticjob/pull/1708/diff?src=pr&el=tree#diff-ZWxhc3RpY2pvYi1pbmZyYS9lbGFzdGljam9iLWluZnJhLWNvbW1vbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvZWxhc3RpY2pvYi9pbmZyYS9lbnYvSXBVdGlscy5qYXZh) | `60.00% <0.00%> (-4.62%)` | `0.00% <0.00%> (ø%)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere-elasticjob/pull/1708?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere-elasticjob/pull/1708?src=pr&el=footer). Last update [b214854...586fbc1](https://codecov.io/gh/apache/shardingsphere-elasticjob/pull/1708?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] Technoboy- merged pull request #1708: Update documents and examples of Spring Boot Starter

Posted by GitBox <gi...@apache.org>.
Technoboy- merged pull request #1708:
URL: https://github.com/apache/shardingsphere-elasticjob/pull/1708


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org