routing

How to trigger Apache camel route from my java method

此生再无相见时 提交于 2021-02-07 11:13:51
问题 I am new to Apache Camel. My requirement is to trigger an Apache camel route in my code flow from method A(). Also I need to pass the object param of A() to the route. I do not want to use amq, file etc components. code : public void A(MyObjectType param) { //Need to call camel route with "param" } What's the best way to do this? 回答1: You can use the ProducerTemplate option, ProducerTemplate template = exchange.getContext().createProducerTemplate() and then you can do template.sendBody The

How to trigger Apache camel route from my java method

时光怂恿深爱的人放手 提交于 2021-02-07 11:13:47
问题 I am new to Apache Camel. My requirement is to trigger an Apache camel route in my code flow from method A(). Also I need to pass the object param of A() to the route. I do not want to use amq, file etc components. code : public void A(MyObjectType param) { //Need to call camel route with "param" } What's the best way to do this? 回答1: You can use the ProducerTemplate option, ProducerTemplate template = exchange.getContext().createProducerTemplate() and then you can do template.sendBody The

How to get parameters from the Angular ActivatedRoute

非 Y 不嫁゛ 提交于 2021-02-07 10:50:56
问题 I'm trying to get the prameter :id from my activated route using observables. When I print params on the console I get the right values for :id. But it's not the case for this.id. I get the value NaN. Can you tell me what is the problem export class RecipeEditComponent implements OnInit { id: number; editMode = false; constructor(private route: ActivatedRoute) { } ngOnInit() { this.route.params.subscribe( (params: {id: string}) => { this.id = +params.id; console.log(this.id); } ); } } 回答1:

MVC 5 Routing with parameter using @Url.RouteUrl

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-07 10:45:51
问题 I have an ActionResult that I have applied a routing attribute to: [Route("myproduct/{productID}", Name = "myproduct")] [MvcSiteMapNode(Title = "Products", ParentKey = "products", Key = "myproducts")] public ActionResult myproducts(int productID) ... I am trying to link to the view via a RouteUrl: <a href="@Url.RouteUrl("myproducts", @Model.myproducts[i].productID)">Buy</a> The resulting html does not even include a href: <a>Buy</a> If I remove the parameter it works: [Route("myproducts",

Angular2 Routing. The requested path contains undefined segment at index 1

痴心易碎 提交于 2021-02-06 14:42:10
问题 I have a issue with routing in Angular 2. I call router.navigate from an action into a datatable. The rare is that sometimes when i click the button that calls this line its works fine and sometimes it doesnt. this.router.navigate(['edit', id], {relativeTo: this.activatedRoute}); The error that shows the inspector element is: The requested path contains undefined segment at index 1 Im using Angular2, DataTables, and Webpack 回答1: Probably your id that pass into in navigate is undefined or null

How to mention dynamic directory path in Apache camel route

梦想的初衷 提交于 2021-01-29 11:01:01
问题 I am trying to take files from different directories. For example I have following directory Structure vendors/dir1/files/heelo.txt vendors/dir2/files/hello2.txt in this there are 3 dirs: 1.vendors 2.dir1 and dir2 3.files since 2. dir1 and dir2 is different, so I have to take it dynamically. I have written following code: <routes xmlns="http://camel.apache.org/schema/spring"> <route id="com.performancebikes.Inventory1" autoStartup="false"> <from uri="b2bmbFileSystem://com.a/vendors/${file

Angular routing between views

萝らか妹 提交于 2021-01-29 09:02:08
问题 I have created a login page using Angular 7. I have created how the login page looks in the initial app.component.html file and I implemented the logic at app.component.ts file. I also put a link "Forgot password". I put a router link redirecting to the forgot-password.component.html . The url changes correctly (from localhost:4200 to localhost:4200/forgot-password ) but the forgot-password.component.html is drawn on top of the previous login page. http://prntscr.com/malk00 How can I erase

ASP.NET ASP 2 - Prioritize Routing?

喜夏-厌秋 提交于 2021-01-29 03:53:49
问题 For a project, I'm having dynamic pages that are retrieved from a content database. However, some pages require some additional computing. So, I thought I'd create a specific controller/view for those, and they would only be hit when they exist, otherwise, my dynamic route would catch it, and let the content controller retrieve database content for the specified route. I hope I explained it right, but here's some code from my Global.asax that might explain it a bit more: routes.MapRoute( //

ASP.NET ASP 2 - Prioritize Routing?

天涯浪子 提交于 2021-01-29 03:51:13
问题 For a project, I'm having dynamic pages that are retrieved from a content database. However, some pages require some additional computing. So, I thought I'd create a specific controller/view for those, and they would only be hit when they exist, otherwise, my dynamic route would catch it, and let the content controller retrieve database content for the specified route. I hope I explained it right, but here's some code from my Global.asax that might explain it a bit more: routes.MapRoute( //

Exception thrown while starting consumer - (Cannot assign same group name for different channels in a microservice )

老子叫甜甜 提交于 2021-01-28 07:52:22
问题 I am a newbie in Spring cloud stream and rabbitmq. Recently I got an Exception after started one of my microservice. It is stating that could not register object because it is already registered, I think it is is because of the group name that assigned for each channel, please check the exception, 2018-05-28 10:01:38.420 ERROR 10244 --- [ask-scheduler-2] o.s.cloud.stream.binding.BindingService : Failed to create consumer binding; retrying in 30 seconds org.springframework.cloud.stream.binder