-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
896 lines (722 loc) · 37.4 KB
/
index.html
File metadata and controls
896 lines (722 loc) · 37.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
<!DOCTYPE html>
<html lang="en">
<head>
<title>
Feign
</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,700,300,400" rel="stylesheet" type="text/css">
<link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
<link rel="stylesheet" href="http://seedstack.org/assets/unify/css/style.css">
<link rel="stylesheet" href="http://seedstack.org/assets/unify/plugins/font-awesome/css/font-awesome.css">
<link rel="stylesheet" href="http://seedstack.org/css/style.css">
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Organization",
"url": "http://seedstack.org",
"logo": "http://seedstack.org/img/logos/seedstack.png"
}
</script>
<meta property="og:title" content='Feign' />
<meta property="og:description" content="This component allows you to define an HTTP client with a simple Java interface that you can then inject and use transparently
in your code." />
<meta property="og:url" content="http://seedstack.org/addons/feign/" />
<meta property="og:site_name" content="SeedStack" />
<meta property="og:image" content="http://seedstack.org/img/opengraph.png" />
<link rel="search" type="application/opensearchdescription+xml" href="http://seedstack.org/opensearch.xml" title="SeedStack" />
<link rel="apple-touch-icon" sizes="57x57" href="http://seedstack.org/img/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="http://seedstack.org/img/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="http://seedstack.org/img/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="http://seedstack.org/img/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="http://seedstack.org/img/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="http://seedstack.org/img/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="http://seedstack.org/img/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="http://seedstack.org/img/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="http://seedstack.org/img/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="http://seedstack.org/img/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="http://seedstack.org/img/favicons/favicon-194x194.png" sizes="194x194">
<link rel="icon" type="image/png" href="http://seedstack.org/img/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="http://seedstack.org/img/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="http://seedstack.org/img/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="http://seedstack.org/img/favicons/manifest.json">
<meta name="apple-mobile-web-app-title" content="SeedStack">
<meta name="application-name" content="SeedStack">
<meta name="msapplication-TileColor" content="#00a300">
<meta name="msapplication-TileImage" content="/img/favicons/mstile-144x144.png">
<meta name="theme-color" content="#ffffff">
<script type="text/javascript">
window.seedstack = {
baseUrl: "http:\/\/seedstack.org\/",
state: {}
};
</script>
</head>
<body>
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-5R5FP9"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-5R5FP9');</script>
<div id="header">
<div class="header">
<div class="container">
<a class="logo" href="http://seedstack.org/">SeedStack</a>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="fa fa-bars"></span>
</button>
</div>
<div class="collapse navbar-collapse navbar-responsive-collapse" data-role="navigation" style="pointer-events: none;">
<div class="container">
<ul class="nav navbar-nav" style="pointer-events: auto;">
<li class=''>
<a href="http://seedstack.org/docs">Documentation</a>
</li>
<li class=''>
<a href="http://seedstack.org/guides">Guides</a>
</li>
<li class='active'>
<a href="http://seedstack.org/addons">Add-ons</a>
</li>
<li class=''>
<a href="http://seedstack.org/posts">News</a>
</li>
<li class=''>
<a href="http://seedstack.org/community">Community</a>
</li>
<li class='dropdown '>
<a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown">
More
</a>
<ul class="dropdown-menu">
<li><a href="http://seedstack.org/glossary">Glossary</a></li>
<li><a href="http://seedstack.org/tags">Tags</a></li>
<li><a href="http://seedstack.org/project">Project info</a></li>
<li><a target="_blank" href="http://seedstack.org/javadoc"><i style="margin-top: 3px" class="pull-right fa fa-external-link"></i> Javadoc</a></li>
<li><a target="_blank" href="https://github.com/seedstack/distribution/releases"><i style="margin-top: 3px" class="pull-right fa fa-external-link"></i> Releases</a></li>
<li><a target="_blank" href="https://github.com/seedstack"><i style="margin-top: 3px" class="pull-right fa fa-external-link"></i> GitHub</a></li>
</ul>
</li>
<li>
<i class="search fa fa-search search-btn"></i>
<div class="search-open">
<form method="GET" action="http://seedstack.org/search">
<div class="input-group animated fadeInDown">
<input id="search-field" type="text" class="form-control" placeholder="Search" name="q">
<span class="input-group-btn">
<button class="btn-u" type="submit">Go</button>
</span>
</div>
</form>
</div>
</li>
</ul>
</div>
</div>
</div>
<div class="title-header small">
<div class="container">
<div class="row">
<div class="col-md-9 col-sm-12">
<h1>Add-ons</h1>
<p class="hidden-xs">Additional features and extensions for SeedStack applications.</p>
</div>
<div class="col-md-3 hidden-sm hidden-xs">
<div class="header-image-wrapper">
<img class="header-image" src="http://seedstack.org/img/logos/addons-logo.svg">
</div>
</div>
</div>
</div>
</div>
<div class="title-subheader">
<div class="container">
<ul>
<li><span><i class="fa fa-chevron-left"></i> <a href="http://seedstack.org/addons">Back to list</a></span></li>
</ul>
</div>
</div>
</div>
<div id="content" class="container">
<div class="row">
<div class="col-md-12">
<div class="content-wrapper">
<div class="doc-content">
<h1 class="nocount">Feign</h1>
<p>This component allows you to define an HTTP client with a simple Java interface that you can then inject and use transparently
in your code.</p>
<div class="tab-v2">
<ul class="nav nav-tabs">
<li class="active"><a href="#tab-org-seedstack-addons-feign-feign-maven" data-toggle="tab" aria-expanded="true"><img class="pull-left" style="margin: 0 5px 0 0; height: 20px;" src="http://seedstack.org//img/logos/maven.png">Maven</a></li>
<li class=""><a href="#tab-org-seedstack-addons-feign-feign-gradle" data-toggle="tab" aria-expanded="true"><img class="pull-left" style="margin: 0 5px 0 0; height: 20px;" src="http://seedstack.org//img/logos/gradle.png">Gradle</a></li>
</ul>
<div class="clear-both"></div>
<div class="tab-content" style="padding-top: 0;">
<div class="tab-pane in active" id="tab-org-seedstack-addons-feign-feign-maven">
<pre style="margin-top: 0; border: solid 1px #eee; border-top: none;"><code class="language-xml no-linenums" style="background-color: #fff;"><dependency>
<groupId>org.seedstack.addons.feign</groupId>
<artifactId>feign</artifactId><span id="org-seedstack-addons-feign-feign-version" style="display: none;">
<version>1.5.0</version></span>
</dependency></code></pre>
<small class="pull-right" style="color: #aaa; margin-top: -20px; margin-right: 5px;">
<span id="org-seedstack-addons-feign-feign-warn" style="display: none;"><i class="fa fa-warning" style="color: orange;"></i> Specifying versions manually is error-prone, use <a href="http://seedstack.org/docs/basics#dependency-management">dependency management</a> instead.</span>
<a style="cursor: pointer; display: block;" id="org-seedstack-addons-feign-feign-show" onclick="$('#org-seedstack-addons-feign-feign-version, #org-seedstack-addons-feign-feign-warn').show(); $('#org-seedstack-addons-feign-feign-show').hide();">Show version</a>
</small>
</div>
<div class="tab-pane in" id="tab-org-seedstack-addons-feign-feign-gradle">
<pre style="margin-top: 0; border: solid 1px #eee; border-top: none;"><code class="language-gradle no-linenums" style="background-color: #fff;">dependencies {
compile("org.seedstack.addons.feign:feign:1.5.0")
}</code></pre>
</div>
</div>
</div>
<h2 id="how-to-use">How to use</h2>
<p>First, you need to create an interface annotated by <code>@FeignApi</code>, with each method being an HTTP call. Annotate each method with <code>@RequestLine</code>:</p>
<pre><code class="language-java">@FeignApi
public interface Api {
@RequestLine("GET /message")
List<Message> getMessages();
@RequestLine("GET /message/{id}")
Message getMessage(@Param("id") int id);
}
</code></pre>
<p>Then, you can use this API by injecting it:</p>
<pre><code class="language-java">public class MyClass {
@Inject
private Api api;
@Logging
private Logger logger;
public void someMethod() {
List<Message> messages = api.getMessages();
for (Message message : messages) {
logger.info("Received message from {}", message.author);
}
}
}
</code></pre>
<p><div class="callout callout-info">
<div style="display:table; width: 100%">
<div style="display:table-cell; width: 50px; vertical-align: middle;">
<i class="fa fa-info-circle icon-2x" style="line-height: 30px;"></i>
</div>
<div style="display:table-cell; vertical-align: middle;">
<p>For more information about OpenFeign, look into its documentation: <a href="https://github.com/OpenFeign/feign">https://github.com/OpenFeign/feign</a>.</p>
</div>
</div>
</div></p>
<h2 id="configuration">Configuration</h2>
<p>Configuration is done by</p>
<p>Feign is configurable by endpoint, and in its basic form is:</p>
<div class="tab-v2">
<ul class="nav nav-tabs">
<li class="active"><a href="#tab-feign-config" data-toggle="tab" aria-expanded="true">Configuration</a></li>
<li class=""><a href="#tab-feign-dump" data-toggle="tab" aria-expanded="true">Tool</a></li>
</ul>
<span class="tabs-icon fa-2x fa fa-wrench pull-right"></span>
<div class="clear-both"></div>
<div class="tab-content" style="padding-top: 0;">
<div class="tab-pane in active" id="tab-feign-config"><pre><code class="language-yaml">feign:
endpoints:
com.mycompany.myapp.Api: http://base.url.to.api:port
</code></pre>
<p><code>com.mycompany.myapp.Api</code> is the fully qualified name of your api interface, and you can add as many as you want.
<code>http://base.url.to.api:port</code> is the base URL of this API.</p>
<p>With all the options, the configuration file looks like this:</p>
<pre><code class="language-yaml">feign:
endpoints:
com.mycompany.myapp.Api:
baseUrl: http://base.url.to.api:port
encoder: feign.jackson.JacksonEncoder
decoder: feign.jackson.JacksonDecoder
errorDecoder: com.mycompany.myapp.MyApiErrorDecoder
logger: feign.slf4j.SLF4JLogger
logLevel: NONE
hystrixWrapper: AUTO
fallback: com.mycompany.myapp.Fallback
retryer: com.mycompany.myapp.MyRetryer
</code></pre>
<p>The values in this example are the default values, except for <code>baseUrl</code> and <code>fallback</code> that don’t have default values.</p>
<ul>
<li><code>baseUrl</code> is this only mandatory option.</li>
<li><code>encoder</code> and <code>decoder</code> let you configure how your data is transformed when sent and received, respectively.</li>
<li><code>errorDecoder</code> let you define a custom injectable errorDecoder related to this API for request error handling. (See <a href="https://github.com/OpenFeign/feign#error-handling">https://github.com/OpenFeign/feign#error-handling</a> )</li>
<li><code>logger</code> let you choose which logger to use to log the requests.</li>
<li><code>logLevel</code> is an enum (<code>NONE</code>, <code>BASIC</code>, <code>HEADERS</code>, <code>FULL</code>).</li>
<li><code>hystrixWrapper</code> is an enum (<code>AUTO</code>, <code>ENABLED</code>, <code>DISABLED</code>). Feign comes with Hystrix circuit-breaker support. <code>DISABLED</code> disables this functionality. <code>ENABLED</code> tells Feign to wrap all requests in Hystrix mechanism, but the lib Hystrix must be in the classpath of your project. <code>AUTO</code> mode will scan the classpath and if Hystrix is present, will wrap requests with it.</li>
<li><code>fallback</code> takes a fully qualified class name and is only relevant when Hystrix is used. The fallback class must implement your API interface and will be used to return default values in case the requests are in error.</li>
<li><code>retryer</code> let you define a custom injectable Retryer related to this endpoint for retry policy handling. ( See <a href="https://github.com/OpenFeign/feign#retry">https://github.com/OpenFeign/feign#retry</a> ). See below for more retry configuration options.</li>
</ul>
<h2 id="authentication">Authentication</h2>
<p>To call an API protected with authentication you can specify a header in your Feign interface with the <code>@Headers</code> annotation (example for basic authentication):</p>
<pre><code class="language-java">@FeignApi
@Headers({"Authorization: Basic {credentials}"})
public interface neosdServer {
@RequestLine("GET /file/getfilesprop")
List<NeosdFile> getfilesprop(@Param("credentials") String credentials);
@RequestLine("GET /file/getfiles")
List<String> getfiles(@Param("credentials") String credentials);
}
</code></pre>
<div class="callout callout-info">
<div style="display:table; width: 100%">
<div style="display:table-cell; width: 50px; vertical-align: middle;">
<i class="fa fa-info-circle icon-2x" style="line-height: 30px;"></i>
</div>
<div style="display:table-cell; vertical-align: middle;">
<p>Note that <code>@Headers</code> can also be used on individual methods.</p>
</div>
</div>
</div>
<p>Then, pass the credentials as method parameter. An example implementation, with credentials coming from your application configuration, coudl be:</p>
<pre><code class="language-java">public class MyClass {
@Configuration("myApp.credentials.user")
private String username;
@Configuration("myApp.credentials.password")
private String password;
@Inject
private NeoSdClient client;
public void myMethod() {
List<String> files = client.getFiles(encodeCredentials());
}
private String encodeCredentials() {
return BaseEncoding
.base64()
.encode((username + ":" + password)
.getBytes(Charsets.UTF_8));
}
}
</code></pre>
<h2 id="fallback">Fallback</h2>
<p>A fallback class is done by implementing the Feign interface and return default values from it:</p>
<pre><code class="language-java">public class Fallback implements Api {
@Override
List<Message> getMessages() {
// return your default value here
}
@Override
Message getMessage(@Param("id") int id) {
// return your default value here
}
}
</code></pre>
<div class="callout callout-info">
<div style="display:table; width: 100%">
<div style="display:table-cell; width: 50px; vertical-align: middle;">
<i class="fa fa-info-circle icon-2x" style="line-height: 30px;"></i>
</div>
<div style="display:table-cell; vertical-align: middle;">
<p>For more information on Hystrix: <a href="https://github.com/Netflix/Hystrix/wiki">https://github.com/Netflix/Hystrix/wiki</a></p>
</div>
</div>
</div>
<h2 id="retry-configuration">Retry configuration</h2>
<p>Feign plugin retry configuration has two levels : global configuration and endpoint configuration.</p>
<p>The endpoint configuration has priority upon global configration, letting you having global settings and, if necessary specific settings for particular endpoints.</p>
<p>To resume, if an endpoint has a retry configuration set, it will be applyed, if not, the global configuration will be applyed, if there is no retry configuration set (global or specific ), the default feign retry configuration will be applyed.</p>
<p>There are two type of retry configuration : standard parameters or retryer class configuration. Both types can’t be defined for the same configuration level (global /endpoint ).</p>
<h3 id="standard-parameters-configuration">Standard parameters configuration</h3>
<p>The following retry parameters can be set :
* <code>period</code> : The initial time period, in milliseconds, between two requests attemps. Feign will increase this period by half ( multiply by 1.5 ) until it reaches the maximum allowed period.
* <code>maxPeriod</code> : Maximum allowed period, in milliseconds, between two attempts. Feign won’t increase a retry period more than this parameter.
* <code>maxAttempts</code> : Maximum retry attempts for a single request. If the request still fails after the last attempt, the feign API will throw an exception.</p>
<h4 id="global-configuration">Global configuration</h4>
<p>Here is a sample for global retry configuration, applyed to each endpoint with no retry/retryer configuration</p>
<pre><code class="language-yaml">feign:
retry:
period: 100
maxPeriod: 1000
maxAttempts: 3
endpoints:
com.mycompany.myapp.Api: http://base.url.to.api:port
</code></pre>
<h4 id="endpoint-configuration">Endpoint configuration</h4>
<p>Here is a sample for specific endpoint retry configuration, applyed only to this specific endpoint :</p>
<pre><code class="language-yaml">feign:
endpoints:
com.mycompany.myapp.Api: http://base.url.to.api:port
retry:
period: 100
maxPeriod: 1000
maxAttempts: 3
</code></pre>
<h3 id="retryer-class-configuration">Retryer class configuration</h3>
<p>With feign, you can define a retryer having the role to determine if a request should be retryed or not, letting you decide of the retry policy you want to apply to your endpoint ( See <a href="https://github.com/OpenFeign/feign#retry">https://github.com/OpenFeign/feign#retry</a> ). This feature is supported in the seedstack feign plugin. Your custom retryer class has to implement the feign «Retryer» interface and added to your plugin configuration. Note that this class is injectable.</p>
<h4 id="global-configuration-1">Global configuration</h4>
<p>Here is a sample for global retryer configuration, applyed to each endpoint with no retry/retryer configuration</p>
<pre><code class="language-yaml">feign:
retryer: com.mycompany.myapp.MyRetryer
endpoints:
com.mycompany.myapp.Api: http://base.url.to.api:port
</code></pre>
<h4 id="endpoint-configuration-1">Endpoint configuration</h4>
<p>Here is a sample for a specific endpoint retryer configuration, applyed only to this specific endpoint :</p>
<pre><code class="language-yaml">feign:
endpoints:
com.mycompany.myapp.Api: http://base.url.to.api:port
retryer: com.mycompany.myapp.MyRetryer
</code></pre>
</div>
<div class="tab-pane in" id="tab-feign-dump">
<p style="margin-top: 20px;">To dump the <code>feign</code> configuration options:</p>
<pre><code class="language-bash">mvn -q -Dargs="feign" seedstack:config</code></pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="toc">
<div class="toc" data-spy="affix" data-offset-top="314" data-offset-bottom="336">
<div>
</div>
<br/>
<div>
<p class="title">On this page</p>
<nav id="TableOfContents">
<ul>
<li>
<ul>
<li><a href="#how-to-use">How to use</a></li>
<li><a href="#configuration">Configuration</a></li>
</ul></li>
</ul>
</nav>
</div>
<br/>
<div>
<a href='https://github.com/seedstack/feign-addon/edit/docs/index.md' target="_blank"><i class="fa fa-edit"></i> Edit this page</a>
</div>
</div>
</div>
<div id="footer">
<a class="scrollup">Scroll</a>
<div class="footer-v3">
<div class="footer">
<div class="container">
<div class="row">
<div class="col-md-4 md-margin-bottom-40">
<div class="headline"><h2>About</h2></div>
<p class="margin-bottom-25 md-margin-bottom-40">
SeedStack is an opinionated, easy-to-use Java development stack for building applications and micro-services.
</p>
<p>
<i class="fa fa-file-text"></i> <a target="_blank" href="http://seedstack.org/docs">Docs</a>
<i class="fa fa-info-circle"></i> <a target="_blank" href="http://seedstack.org/javadoc">Javadoc</a>
<i class="fa fa-book"></i> <a target="_blank" href="http://seedstack.org/guides">Guides</a>
<i class="fa fa-plug"></i> <a target="_blank" href="http://seedstack.org/addons">Add-ons</a>
<br/>
<i class="fa fa-keyboard-o"></i> <a style="cursor: pointer;" onclick="seedstack.ui.openHelp();">Keyboard shortcuts</a>
</p>
</div>
<div class="col-md-4 md-margin-bottom-40">
<div class="posts">
<div class="headline"><h2>License and credits</h2></div>
<p>
Code licensed under the <a href="https://www.mozilla.org/MPL/2.0" target="_blank">Mozilla Public License 2.0</a>.
<br/>
Documentation licensed under <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>.
<br/>
Some illustrations by <a href="https://www.Vecteezy.com/">www.Vecteezy.com</a>
</p>
</div>
</div>
<div class="col-md-4 map-img">
<div class="headline"><h2>Contact us</h2></div>
<address>
<p>
<i class="fa fa-stack-overflow"></i> <a target="_blank" href="http://stackoverflow.com/questions/ask?tags=seedstack">StackOverflow</a>
<br/>
<i class="fa fa-comments"></i> <a target="_blank" href="https://kiwiirc.com/client/irc.freenode.net#seedstack">IRC</a>
<br/>
<i class="fa fa-github"></i> <a target="_blank" href="https://github.com/seedstack">GitHub</a>
<br/>
<i class="fa fa-link"></i> <a target="_blank" href="https://projects.ow2.org/bin/view/seedstack/">OW2</a>
</p>
</address>
<div class="headline"><h2>Stay in touch</h2></div>
<div style="margin-bottom: 20px;">
<a class="twitter-follow-button"
href="https://twitter.com/seedstack"
data-show-count="false"
data-size="large"
data-lang="en">
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="hotkeys-modal" class="modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">×</span></button>
<h4 class="modal-title">Keyboard shortcuts</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<table class="keyboard-mappings">
<tbody>
<tr>
<td class="keys">
<kbd>?</kbd>
</td>
<td>Show this help dialog</td>
</tr>
<tr>
<td class="keys">
<kbd>/</kbd>
</td>
<td>Focus the search field</td>
</tr>
<tr style="height: 20px;"><td></td></tr>
<tr>
<td class="keys">
<kbd><i class="fa fa-arrow-left"></i></kbd>
</td>
<td>Go to previous page</td>
</tr>
<tr>
<td class="keys">
<kbd><i class="fa fa-arrow-right"></i></kbd>
</td>
<td>Go to next page</td>
</tr>
<tr style="height: 20px;"><td></td></tr>
<tr>
<td class="keys">
<kbd>g</kbd> <kbd>d</kbd>
</td>
<td>Go to documentation</td>
</tr>
<tr>
<td class="keys">
<kbd>g</kbd> <kbd>a</kbd>
</td>
<td>Go to add-ons library</td>
</tr>
<tr>
<td class="keys">
<kbd>g</kbd> <kbd>g</kbd>
</td>
<td>Go to guides list</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="versions-modal" class="modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">×</span></button>
<h4 id="versions-title" class="modal-title">Fetching components...</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<table id="versions-table" class="table table-striped table-hover table-bordered">
<tr>
<th>Component</th>
<th>Version</th>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/idea.min.css">
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/yaml.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/gradle.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlightjs-line-numbers.js/2.1.0/highlightjs-line-numbers.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/mousetrap/1.4.6/mousetrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.6.0/clipboard.min.js"></script>
<script src="/js/jquery.highlight.js"></script>
<script src="/js/seedstack.js"></script>
<script>
$(document).ready(function () {
var $search = $('.search-btn');
$('.search').click(function () {
if ($search.hasClass('fa-search')) {
seedstack.ui.openSearch();
} else {
seedstack.ui.closeSearch();
}
});
function hideJavaImports(block) {
$(block).filter('.language-java')
.find('table > tbody > tr')
.each(function (i, javaLine) {
var $javaLine = $(javaLine);
var code = $javaLine.find("td.hljs-ln-code div.hljs-ln-line").text();
if (/^package/.test(code) || /^import/.test(code) || code.trim().length === 0) {
$javaLine.hide();
} else {
return false;
}
});
}
$('pre code').each(function (i, block) {
hljs.highlightBlock(block);
if ($(block).not('.no-linenums').length > 0) {
hljs.lineNumbersBlock(block);
var lastLine = $(block).find('table > tbody > tr:last');
if (lastLine.text().trim() === "") {
lastLine.remove();
}
}
hideJavaImports(block);
});
$('.doc-content h2, .doc-content h3').each(function () {
$(this).append(" <a class='title-anchor' href='#" + this.id + "'>#</a>");
});
Mousetrap.bind('/', function () {
seedstack.ui.openSearch();
return false;
});
Mousetrap.bind('left', function () {
if (seedstack.state.previousPage) {
window.location = seedstack.state.previousPage;
}
return false;
});
Mousetrap.bind('right', function () {
if (seedstack.state.nextPage) {
window.location = seedstack.state.nextPage;
}
return false;
});
Mousetrap.bind('?', function () {
seedstack.ui.openHelp();
return false;
});
Mousetrap.bind('esc', function () {
seedstack.ui.closeHelp();
seedstack.ui.closeSearch();
seedstack.ui.closeVersions();
return false;
});
var originalCallback = Mousetrap.stopCallback;
Mousetrap.stopCallback = function (e, element, combo) {
if (combo === 'esc') {
return false;
}
return originalCallback(e, element, combo);
};
function bindShortcuts(value) {
$.each(value, function (sequence, item) {
if (typeof item === 'string') {
Mousetrap.bind("g " + sequence, function () {
window.location = item;
return false;
});
} else if (typeof item === 'object') {
Mousetrap.bind("g " + sequence, function () {
window.location = item.path;
return false;
});
if (item.shortcuts && location.pathname.indexOf(item.path) === 0) {
bindShortcuts(item.shortcuts);
}
}
});
}
bindShortcuts(seedstack.ui.shortcuts);
$('.quick-paste span').each(function (index, element) {
$(element).attr({"id": "quick-paste-line"});
$(element).append("<span data-toggle=\"tooltip\" data-placement=\"top\" data-title=\"Copy\" data-clipboard-target=\"#quick-paste-line\" class=\"copy-button\"><i class=\"fa fa-clipboard\"></i></span>");
});
var preId = 0;
$('.doc-content pre').each(function (index, element) {
preId++;
$(element).attr({"id": "snippet-" + preId});
$(element).prepend("<span data-toggle=\"tooltip\" data-placement=\"left\" data-title=\"Copy\" data-clipboard-target=\"#snippet-" + preId + "\" class=\"copy-button\"><i class=\"fa fa-clipboard\"></i></span>");
});
var clipboard = new Clipboard('.copy-button', {
target: function (trigger) {
var elt = $($(trigger).data('clipboard-target'));
elt.find('code > table > tbody > tr').show();
return elt.get(0);
}
});
clipboard.on('success', function (e) {
var elt = $($(e.trigger).data('clipboard-target'));
hideJavaImports($(elt).children("code"));
var tooltip = $("body #" + $(e.trigger).attr("aria-describedby"));
tooltip.css('left', '-=14px');
tooltip.children(".tooltip-inner").html("Copied!");
e.clearSelection();
});
clipboard.on('error', function (e) {
var tooltip = $("body #" + $(e.trigger).attr("aria-describedby"));
tooltip.css('left', '-=83px');
tooltip.children(".tooltip-inner").html("Error! Copy manually");
});
$('[data-toggle="tooltip"]').tooltip({
container: 'body'
});
$('#hotkeys-modal, #versions-modal').bind('hidden.bs.modal', function () {
$("html").css("margin-right", "0px");
}).bind('show.bs.modal', function () {
$("html").css("margin-right", "-15px");
});
var query = seedstack.strings.parseQueryString(location);
if (query.h && query.h.length > 0) {
$('.doc-content').highlight(query.h);
if (query.scroll) {
var firstOccurence = $('span[class=highlight]:first');
if (firstOccurence.length > 0) {
$('html, body').animate({
scrollTop: firstOccurence.offset().top - 20
}, 250);
}
}
}
$(window).scroll(function () {
if ($(this).scrollTop() > 200) {
$('.scrollup').fadeIn();
} else {
$('.scrollup').fadeOut();
}
});
$('.scrollup').click(function () {
$("html, body").animate({scrollTop: 0}, 250);
return false;
});
});
</script>
<script>window.twttr = (function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0], t = window.twttr || {};
if (d.getElementById(id)) return t;
js = d.createElement(s);
js.id = id;
js.src = "https://platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js, fjs);
t._e = [];
t.ready = function (f) {
t._e.push(f);
};
return t;
}(document, "script", "twitter-wjs"));</script>
</body>
</html>