记一次多线程调用Feign接口失败问题

记一次多线程调用Feign接口失败问题,第1张

在一次调用FeignClient时,开启了40多个线程调用,然而每次只能调通10个。查看日志发现:

Task javautilconcurrentFutureTask@2019af96 rejected from javautilconcurrentThreadPoolExecutor@78cc480d[Running, pool size = 10, active threads = 10, queued tasks = 0, completed tasks = 0]

根据其提示我们可以看出线程池大小只有10,从而拒绝执行新的线程,触发了Hystrix熔断机制。查阅 Hystrix文档 发现Hystrix为每个依赖提供一个小的线程池(或信号)( 默认10个线程 ),如果线程池已满调用将被立即拒绝。可以通过修改配置提高Hystrix的并发能力,在配置文件中加入:

hystrix:

  threadpool:

    default:

      coreSize: 50  # 设置线程池大小为50

从Spring Cloud Edgware开始,Feign支持使用属性自定义Feign。对于一个指定名称的Feign Client(例如该Feign Client的名称为 feignName ),Feign支持如下配置项:

Spring Cloud Feign 支持对请求和响应进行GZIP压缩,以减少通信过程中的性能损耗。通过下面的参数 即可开启请求与响应的压缩功能:

同时,我们也可以对请求的数据类型,以及触发压缩的大小下限进行设置:

注:上面的数据类型、压缩大小下限均为默认值。

在开发或者运行阶段往往希望看到Feign请求过程的日志记录,默认情况下Feign的日志是没有开启的。 要想用属性配置方式来达到日志效果,只需在 applicationyml 中添加如下内容即可:

经典英语谚语50句
1 Waste not,want not 俭以防匮。
2 From saving comes having 富有来自节俭。
3 A penny saved is a penny gained 省一文是一文。
4 Take care of the pence and the pound will take care of themselves 金钱积少便成多。
5 Frugality is an estate alone 节俭本身就是一宗财产。
6 He that regards not a penny,will lavish a pound 小钱不知节省,大钱将滥花。
7 Small gains bring great wealth 积小利,成巨富。
8 Many a little makes a mickle 积少便成多。
9 As the touchstone tries gold,so gold tries man 试金之石可试金,正如黄金能试人。
10 Courage and resolution are the spirit and soul of virtue 勇敢和坚决是美德的灵魂。
11 The path to glory is always rugged 光荣之路常坎坷。
12 Nothing is difficult to the man who will try 世上无难事,只要人肯试。
13 The fire is the test of gold;adversity of strong man 烈火试真金,困苦炼壮士。
14 Great hopes make great man 远大的希望造就伟大的人物。
15 No way is impossible to courage 勇士面前无险路。
16 A smooth sea never made a skillful mariner 平静的大海决不能造就出熟练的水手。
17 The good seaman is known in bad weather 坏天气下才能识得出良好的海员;要识好海员,须凭坏天气。
18 The best hearts are always the bravest 行为最勇敢的人心地总是最善良。
19 We must not lie down,and cry,God help us 求神不如求己。
20 He that falls today may be up again tomorrow 今天跌倒的人也许明天就会站起。
21 Rome was not built in a day 罗马并非一日可建成;坚持必成。
22 Success belongs to the persevering 胜利属于坚忍不拔的人。
23 We must repeat a thousand and one times thatperseverance is the only road to success 我们要多次重申:不屈不挠是取得胜利的唯一道路。
24 Perseverance is failing nineteen times and succeeding the twentieth 十九次失败,到第二十次获得成功,这就叫坚持。
25 Step by step the ladder is ascended 登梯需要逐级登。
26 Adversity leads to prosperity 困苦通向昌盛。
27 Patience and application will carry us through 忍耐和专心会使我们度过难关。
28 Fortune often rewards with interest those that have patience to wait for her 做事只要有耐心,到头总会有好运;耐心候好运,好运常会来。
29 All things will come round to him who will but wait 只要肯等待,一切都会按时来。
30 Constant dropping wears the stone 滴水不绝可穿石。
31 Omelets are not made without breaking of eggs 鸡蛋不打破,蛋卷做不成;不甘愿吃苦,则预期效果达不到。
32 The world is a ladder for some to go up and others to go down 世界好似一把梯,有人上去有人下。
33 There needs a long apprenticeship to understand the mystery of the world's trade 要知世事奥秘多,须要长期作学徒。
34 Life is sweet 生活是可爱的;人无不好生(恶死)。
35 Where there is life,there is hope 生命不息,希望长在。
36 Life is not all beer and skittles 人生并不全是吃喝玩乐。
37 Much water runs by the mill that the miller knows not of 眼前发生许多事,有些我们并不知。
38 Fortune knocks once at least at every man's door 人人都有走运的一天。
39 If you are too fortunate,you will not know yourself; if you are too unfortunate,nobody will know you 运气太好,见人不睬;运气太坏,无人理会。
40 Every man is the architect of his own fortune 每一个人都是自身幸福的建筑师。
41 Happy is he who knows his follies in his youth 记得年轻时所作蠢事的人是幸福的。
42 Misfortunes never (seldom) come alone (single)
祸不单行。
43 Misfortune is a good teacher 不幸是良好的教师。
44 Misfortunes come at night 祸常生于不测。
45 Misfortunes tell us what fortune is 恶运临头后,才知幸运贵。
46 Adversity makes a man wise,not rich 患难能使人聪明,但不能使人富有。
47 Live and learn 活到老,学到老。
48 It is never too old to learn 为学不怕年高。
49 A man becomes learned by asking questions 要长学问,就得多问;多问则业精。
50 There is no royal road to learning 学问无坦途。
回答者:Robin_1120 - 魔法学徒 一级 2-10 17:52
提问者对于答案的评价:
谢谢
评价已经被关闭 目前有 3 个人评价

66% (2) 不好
33% (1)
对最佳答案的评论
good
评论者: feifei_manman - 试用期 一级
A rolling stone has no moss户疏不蠹,流水不腐 (滚石不生苔) Every dog has its day人人都有得意之时。 Man proposes God disposes谋事在人,成事在天。
评论者: 猫的名字 - 试用期 一级
thank you
评论者: 冰梦飞扉 - 试用期 一级
更多>>
其他回答共 5 条
1、A man is not old as long as he is seeking something A man is not old until regrets take the place of dreams (J Barrymore)
只要一个人还有追求,他就没有老。直到后悔取代了梦想,一个人才算老。(巴里摩尔)
as long as是经常用的连接词,有两个意思。第一种表示既然、由于,同since接近,比如As long as you've offered this sports car, I'll accept it既然你要给我这辆跑车,我就接受了。第二种意思表示只要,引导条件状语从句,这种意思较第一种常见,也就是格言中的用法。
例如,I'll let her go as long as you give me ten thousand pounds只要你给我一万英镑,我就放了她。这时,往往可以用provided that替换。I'll let her go provided that you give me ten thousand pounds但显然,provided that要正式些。
这句话中还有一个词组:take the place of,它的意思是代替,这里的the一定不能省略。例如:The computer is taking the place of TV in our lives再例如: The word "replace" could take the place of "take the place of" in the above example是不是有点糊涂了?在上面的例句中,take the place of也可以用replace代替。
2、A good education gives a man a great pull
良好的教育对人是至关重要的。(良好的教育给人很大的好处。)
这句话中的pull有着其特殊的用法。Pull通常情况下都做动词,有拖、拉、牵的意思;但是这里的pull是名词用法,它的意思是influence, informal special influence that gives you some advantage(有利条件,影响力)。
这句话说明了一个人的成才除了会受到先天的影响,后天的良好教育也是必不可少的。
让我们来看下面一个句子:
The name of his family gives him a lot of pull in this town
在这个小镇上,他的姓氏给他带来了不少好处。
3、Take no thought for tomorrow 莫为明日愁。
这句话出自《圣经》,意谓着未来的事情都由上帝来安排,不必为明天而烦恼。
4、The course of true love never did run smooth 好事多磨。
这句话出自莎士比亚的作品《仲夏夜之梦》(A Midsummer Night Dream)。直译为真正的爱情往往要经历许多挫折。
Course,在这里并不是课程的意思,而是过程,进程,历程的意思。Smooth-free from problems or difficulties,没有问题的,无困难的,顺利的。
只在经过艰苦磨难的爱情,才是真正的爱情,也才会让我们更加懂得如何珍惜。
5、Birds of a feather flock together 物以类聚,人以群分。
A feather,这里是指具有相同的羽毛。Flock,鸟群,词组a flock of可以解释为一群人,一伙人。
比较通俗地来说就是,相同羽毛的鸟类聚集在一起。大家可千万别以为是志同道合,这句话其实通常都用作贬意,有“一丘之貉”之意。所以今后我们在用这个谚语的时候要特别注意。
6、Quality is better than quantity 质胜于量。
Quality--the degree to which something is excellent; stand of goodness质,质量;Quantity--the fact of being measurable; amount量,数量。
我想大家知道哲学里有这样一句话,只有量的积累,才会有质的飞跃。说明量的积累也是同样很重要的,但是在量的积累的同时,千万别忽视了质量上的要求。
7、A hedge between keeps friendship green 保持距离,友谊常青。
Hedge,在这里做名词,解释为树篱,障碍物,也就是用于隔离的东西。在这里教大家另外一个词组,我们平时说的"脚踏两条船"用英语该如何表达呢?那就是Hedge one's bet,这里的hedge做动词用,意思是在两面下注以防损失。引申一下也就是"脚踏两条船"。
这句话其实就是“君子之交淡如水”这样一层意思。
相似的表达句子:Good fences make good neighbors
8、The only way to differentiate yourself from the competition is through service
只有服务才能真正使你在竞争中凸显。
differentiate使分辨、辨别的意思,常同from和between搭配。例如:I can't differentiate between rose and Chinese rose我分不清玫瑰和月季。这句话也可以说成I can't differentiate rose from Chinese rose
但这句名言中differentiate from的意思与这个例句的意思不同,它的意思是"使有差别、有特点从而区别于其他"。那么这句话就是说在激烈的竞争下,只有优质、有特色的服务才能使企业在众多的竞争对手中显示出自己的不同,在竞争中占有一席之地。
参加面试的时候,不妨问问自己“What differentiates me from other candidates for the position"
9、Better an open enemy than a false friend公开的敌人胜于虚假的朋友。
这句话其中也隐含了另一种意思,那就是我们中国人常说的“明q易躲,暗箭难防”。
Open-actions, feelings, or intentions that are not hidden or secret;公开的,在这里做形容词。需注意的是,当open用做形容词时只能位于名词前面,比如说:an open secret一个公开的秘密;
False-untrue,假的,虚伪的,不真实的;
Betterthan,是一个比较句式,意思是比好。
10、Pleasant hours fly fast美好时光最易逝。
Pleasant:愉快的,美好的;fly:飞逝,这里形容时间过得很快,象这样的用法还有:Time flies (时光飞逝)。
这句谚语告诉我们这样一个道理,快乐的时光在不经意间就会流逝,我们应该好好珍惜每一刻的美好瞬间。
11、Joys shared with others are more enjoyed与人同乐,其乐无穷。
Share with:与共享;分担。
For example:
I'd like to share the pie with you我愿与你分享这块馅饼。
在平时的生活中我们经常会听到这样的问题:Can you tell me what is a true joy
每当我们听到这样的问题总是会语塞,不知该如何回答。
Now we can give "true joy" a definition: Joys shared with others are more enjoyed
12、Wonders will never cease 奇迹的出现是不会终止的。
Wonder, something that makes you feel surprise and admiration;奇迹;奇观;奇事。创造奇迹我们可以说:do wonders or make wonders; for a wonder就是说来奇怪,意想不到的意思。
Cease, to stop doing something;停止;终止。
The rain has ceased雨停了。
Without cease,就是不停地,不断地。
不知大家是否留意过英文新闻里经常出现这样一个词:cease-fire, an agreement to stop fighting for a period of time, especially so that a more permanent agreement can be made其实就是停火的意思。
This proverb tells us that we should never give up our hope, because wonders will never cease
13、Hitch your wagon to star 把你的大车套在星星上。/人要志向远大。
这句话意味着人要有远大理想,要立志超脱一切世俗事物。
Hitch, to fasten something,在这里解释为被钩住;被栓住;被套住。Hitchto就是把系上,栓上。这个词还有多种解释:
(1)a problem that delays something for a short time故障;障碍。比如说:讨论顺利地结束了。我们可以这样表达:The discussion passed off without a hitch
(2)informal to ask for a free ride from the drivers of passing cars by putting your hat out with your thumb raised求得免费搭车。免费搭车者我们就说:hitchhiker
Wagon, a strong vehicle with four wheels, used for carrying heavy loads and usually pulled by horse; a large open container pulled by a train, used for carrying goods (in BrE),是指四轮马车;在英式英语中指(铁路)货车。
大家在使用这个谚语的时候需要特别注意一下,虽然这句话含有人要志向远大的意思,但是也有可能是贬义,即:好高骛远。
14、I cannot and will not cut my conscience to fit this year's fashions ----- Hellman
我不能、也不愿毁灭我的良心去迎合时尚。----赫尔曼
conscience means the awareness of a moral or ethical aspect to one''s conduct together with the urge to prefer right over wrong,良心就是对鞭策人行善而非作恶的本能行为在伦理或道德上的意识。例如:Let your conscience be your guide让你的良心指引你。His conscience troubled him after he took the money他拿了钱以后,他的良心使他不安。我们常说的凭良心就是according to one''s conscience,问心无愧是have a clear [good] conscience
关于这个词,有如下习惯用语:
A good conscience is a constant feast (=A good conscience is a soft pillow)
问心无愧,高枕无忧。
A guilty conscience is a self-accuser (=A guilty conscience needs no accuser)
做贼心虚。
A quiet conscience sleeps in thunder 没做亏心事,不怕鬼叫门。
get sth off one''s conscience 解除良心上的负担
have the conscience (to do; to say sth) 竟厚颜无耻到(做、说)
in all conscience 凭良心说,真的,的确,一定
make sth a matter of conscience 凭良心对待〔做〕某事
另外在口语中,我们可以说My conscience!这表示啊呀!嗳!好家伙!(表示惊奇,遗憾等)的意思。
这句格言,其实说的就是一种坚韧不屈的性格。
15、Dying is as natural as living生死是自然法则。/生死有命,富贵在天。
Dying,在这里指死亡。Be dying for/to, to have a real wish for/to (informal),(非正式)恨不得马上;巴不得立刻;非常想:I'm dying for a cigarette我恨不得马上有支烟抽。
As natural as,和一样普通,一样正常。Asas表示和一样,中间必须是形容词的原形。比如:as big as和一样大; as fast as和一样快。
Living,活着;有生命的。这个词还可以解释为现存的;现行的;在使用着的。A living language活语言。
这句谚语告诉我们生与死都是自然规律的一部分。死亡是不可避免的,也是不可怕的。
16、The great end of life is not knowledge but action ----- Huxley
人生的伟大目的不在于知而在于行。-----赫胥黎
knowledge:
1 understanding了解,理解例如:A baby has no knowledge of good and evil小孩儿不解善恶。
2 all that a person knows familiarity gained by experience个人的知识,见闻例如:I have only a limited knowledge of computers我的计算机知识是很有限的。
3 everything that is known, organized body of information学问,学识,知识例如:all branches of knowledge各门学问
knowledge常用的搭配如下:
be common/public knowledge人所共知
It's pointless trying to keep your friendship secret----it's common knowledge already你们无所谓将友情保留---其实已尽人皆知了。
Come to somebody's knowledge被某人熟悉
It has come to our knowledge that you have been cheating the company我们了解你一直欺骗公司。
这句格言,实际是告诉我们做事要实干,仅仅纸上谈兵是不够的。
17、A man without distant care must have near sorrow 人无远虑必有近忧。
Distant-the amount of space between two places or things,远的,悠远的。举例:A distant relative远房亲戚;distant control遥控;long distance长途电话。
Care,通常是照顾;管理;或是小心的意思。比如:Give more care to your spelling多注意你的拼写。在这里care是指忧虑;烦恼;挂念。我们来看一些例子:be free from all care无忧无虑/Care had aged him忧虑使他显得苍老了。
Sorrow-a feeling of great sadness, usually because someone has died or because something terrible has happened to you,悲伤,悲哀。Convert sorrows into strength 化悲痛为力量。
社会竞争日益激烈,人们的压力也越来越大,既有远虑又有近忧的人已不在少数了。还是衷心希望所有的人都能放松心态,舒适地生活。
18、Self-distrust is the cause of most of our failures
我们绝大多数的失败都是因为缺乏自信的缘故。
Distrust - a feeling that you cannot trust someone,不信任,怀疑。Have a distrust of somebody / something,对某人(某事)怀疑。Self-distrust,就是缺乏自信的意思。与之想反的是,self-confidence 充满自信。由self-结构组成的词组还有很多,比如:self-dramatizing 自吹自擂的;self-educated 自学的;self-financing 自筹经费;self-glorifying 自命不凡的;等等。
Cause,原因。the cause of,是导致的原因。
Failure,是动词fail的名词形式,解释为失败。Failure is the mother of success失败是成功之母。也可以解释为失败的人;失败的尝试:He is a failure as an artist他是个失败的艺术家。Fail表示失败或不能;忘记。Don't fail to ring me up不要忘记给我打电话。
这个谚语就告诉我们在做任何一件事情的时候我们都要充满自信。
19、Some people pretend to despise the things they cannot have ---- Aesop
吃不到葡萄的人说葡萄酸。----伊索
pretend means make pretensions,表示假装,矫作的意思。
这里,我们来看一下下列几个词:pretend、feign、assume、affect ,都含"假装"的意思。
pretend指"感觉到某事,而在言行上装出是真的",如: pretend not to hear 假装没听见。
feign指"精心装有或装作",如:feign deafness 装聋。
assume指"装出有某种感情的样子,以掩饰其真正的感情",如:
She assumed a look of sorrow 她假装着悲伤的样子。
affect指"为达到某种效果而假装有某种特征或情感",如:affect a British accent装英国腔。
20、The secret of success is constancy of purpose 成功之秘诀乃为目标之有恒。
Secret - something kept hidden or known about by only a few people,秘密;机密。The secret of health 养身秘诀;make no secret of something 对某事毫不掩饰。
Constancy - the quality of staying the same even though other things change,坚定;坚贞;经久不变。Constancy of purpose目标坚定。
Purpose-the thing that an event, process, or activity is supposed to achieve, or the job that something is supposed to do,意图;目的。What is his purpose in coming他来的意图是什么?
这个谚语告诉我们确立目标,持之以恒就能成功地将事情完成。
21、Knowledge is a treasure, but practice is the key to it
知识是宝库,而实践是开启这一宝库的钥匙。
这句话也就是我们平常一直在说的:理论知识的掌握必须建立在实践的基础之上。如果没有实践经验,掌握的知识是比较抽象的。Treasure,财富,珍宝的意思。这个词还有另外一种形式treasury,可以解释为国库,金库,也有宝库的意思。那么我们平时一直在说的国库券的英语应该怎么表达呢?短期国库券:treasury bill;中期国库券:treasury note。既然解释为宝库,那么就说明里面的东西都是非常经典的,非常珍贵的,也就可以让我们想到另外一个词集锦的表达方式,也是这个treasury。比如说中国诗歌集锦就是a treasury of Chinese poetry。
22、A Jack of all trades is master of none
样样皆通,样样稀松。/通百艺即无一长。
这里的Jack不是我们平时所指的人名,在这里是泛指无特长技术的人。我想大家都听到过这样一句话:All work and no play makes Jack a dull boy同样这里的Jack也是泛指。
Trade在这里的意思是-a particular job, especially one needing special skill with your hands手艺。
这句话的意思其实很简单,就是我们现在比较流行的一个词“三脚猫”啦。看来光会做“三脚猫”还是远远不够的,一定要有自己的某些特长。
A good education gives a man a great pull
"木受绳则直,金就砺则利,君子博学而日参省乎己,则知明而行无过矣。"
荀子《劝学篇》
意思有些相近,荀子的更形象易懂。
23、Man can climb to the highest summit, but he cannot dwell there long (Bernard Shaw)
人可以爬到最高峰但却不能在那儿久住。(萧伯纳)
这句格言中有两个词值得学习,一个是summit,另一个是dwell Summit最基本的意思是顶点、顶端,如:a mountain summit还有能达到的最高水平、程度这样的意思,如:summit of career development, summit of ambition, summit of advancement, etc另外,summit还表示最高级别、最高级别的,首脑会议、政府首脑的,可以做名词,也可以做形容词。频频出现的"高峰会议"这个说法就是从summit来的,可以说summit meeting, summit talk,或直接就是CEO summit。
dwell表示在某地居住,隐含长久居住的意义,是比较正式的用法,并且有dweller居民,dwelling住处,等对应的说法。经常会碰到关于这个词的短语dwell on或者dwell upon。两者几乎没什么差别,意思是细说、详论。例句如:She's dwelling too much on her past她对自己的过去说得太详细了。
24、The spirit is willing, but the flesh is weak 心有余而力不足。
Spirit, the part of a person's mind that is able to think and will be talked about as clearly opposed to the body (与肉体相对而言的)心灵,精神。
Flesh, the physical human body as opposed to the mind or soul (人的)肉体。
这名话源出《圣经》,有力不从心的意思。
25、He loses all who loses the moment 机不可失,时不再来。
Moment在这里不能解释为片刻,它所指的是the time for doing something,时机。
也就是说错过了一次机会,也就是错过了一切。告诉我们在日常生活中每时每刻都要做好准备,当机会来临时就要抓住它,只有这样人生才不会有太多的后悔。
在口语中更常见的说法是:Now or never
26、Distance lends enchantment to the view距离使风景更富魅力。/远看风景更美。
Lendto,在这里并不是把借给的意思,而应该解释为to be suitable for being used in a particular way,有助于;适宜于;对有用。
Enchantment-a feeling of mystery that strongly interests or attracts you魅力;迷人之处;乐事。
View,在这里是风景的意思。英语中表示风景的词还有很多,比如说scenery; landscape, etc
这句谚语出自苏格兰诗人托马斯坎贝尔的《希望的快乐》(The Pleasure of Hope)。揭示这样一个道理:距离产生美;其实人与人相处时应该保持一定的距离,亲密无间不一定是促进友谊的最好途径。
这句可以和第七句参考着学习:7A hedge between keeps friendship green
27、Take the rough with the smooth 逆来顺受。
rough:在这里做名词,译作艰难;(生活的)苦难方面;smooth:同样也做名词,有顺意,平平安安的意思。有这样一个词组:the roughs and the smooths,就是艰难与顺利;苦与乐;人世的甘苦等意思。
人生不如意事十之八九,当我们遇到这样的事情时应该以乐观的心态去面对,这样才会活得快乐。
28、Actions speak louder than words行动胜于空谈。/事实胜于雄辩。
这句话选自美国诗人亨利沃兹沃思朗费罗(Henry Wordsworth Longfell


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/12885204.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-28
下一篇 2023-05-28

发表评论

登录后才能评论

评论列表(0条)

保存