Posts

How to declare reusable transformer in XML without 'input-channel'?

Image
2 In my application I would like to re-use the same message transformer inside of multiple <int:chain> . In such chains I perform http requests to different endpoints and I need to add the same basic authentication header. I would like to declare the code for adding a header only once, i.e: <int:header-enricher id="authHeaderAdder"> <int:header expression="'Basic ' + new String(T(java.util.Base64).encoder.encode(('${http.user}' + ':' + '${http.password}').bytes))" name="Authorization"/> </int:header-enricher> And then I would like to use it with ref in my chain before making http request: <int:chain input-channel="someHttpChain"> <int:transformer ref="authHeaderAdder...

Cardinality of sets and usage of Cantor-Bernstein theorem

Image
2 $begingroup$ I have recently been studying cardinality of finite and infinite sets and the 'theory part' was not hard to understand, but it is pretty problematic for me to apply any of the definitions to solve problems. The first problem is following and I am not sure whether I solved it correctly: Does $A_1sim A_2$ , $B_1sim B_2$ and $|A_1|leq|B_1|$ implies that $|A_2|leq|B_2|$ ? My answer is yes, as $A_1$ is equinumerous to $A_2$ and $B_1$ is equinumerous to $B_2$ , we may assume that $|A_1|=|A_2|=n$ and $|B_1|=|B_2|=m$ . Then, $|A_1|leq|B_1| equiv nleq m$ . As $n=|A_2|$ and $m=|B_2|$ , we get that $|A_1|leq|B_1| Rightarrow |A_2|leq|B_2|$ . The second problem is connected with Cantor-Bernstein theorem , which says that if $|A|leq|B|$ and $|B|leq|A|$ , then $|A|=|B|$ . Using the theorem w...