Create custom Consumer & Producer for an existing Component - apache-camel

I would like to extend the functionalities of an existing camel consumer/producer, and have the same camel component using the my implementation instead of the original consumer/producer.
Can this be done? If yes, how? Appreciate your guidance.

Its just java code, so you can extend the classes and override the methods you want. And if really needed the source code is open so you can copy the old code if you need in your component.
But you may ask yourself why do you need to do this. Its much better to use the standard components as-is.
If you need a new feature then talk to the Apache Camel community about that, and see what can be added to the standard.
http://camel.apache.org/support.html

Related

Purpose of redux-cli

currently looking through a boilerplate called react-redux-start-kit by Dave Zuko, and there is a folder called blueprints. Apparently it is for a library called redux-cli, and having no clue what that is I did some research. (Link to redux-cli)
The problem is, the documentation for redux-cli didn't really say what it is. I have also read that redux-cli makes it faster to build apps. Could someone please explain to me what redux-cli is, and how it works?
redux-cli is a utility that speeds up development by reducing work required to create basic elements of your app, e.g. components. Usually, when you create such component, you have to create file for a component, test suite and they all start with a certain structure that you usually copy / paste from other, existing components. With redux-cli you just use simplified commands in your console to auto-generate those basic versions of a new component and you can just jump in and start writing the essence of it.
blueprints are simply templates, redux-cli uses when running commands (for example when running command to create new component it will look at blueprints directory first and see if you have customized template for how you want your components to be initialized). Documentation is pretty clear I'd say - https://github.com/SpencerCDixon/redux-cli#creating-blueprints

Using Apache Camel Simple in custom Camel Components

I am creating my own custom component for doing various operations. I would like to know what is the best approach to be able to evaluate Simple in my uri, exactly in the remaining and the options. That way I can provide more flexibility. I have already taken a look to http://camel.apache.org/expression.html but I am not really sure how to integrate the evaluation into my java code.
Thanks in advance!
You can see how the file component uses simple/file language for the fileName option.
See the source code of these methods/classes
org.apache.camel.component.file.GenericFileEndpoint#setFileName
org.apache.camel.component.file.GenericFileConsumer#evaluateFileExpression

Custom Request Handlers/Components with Solr-4.x

I was referring this http://sujitpal.blogspot.in/2011/02/solr-custom-search-requesthandler.html for making custom handlers in solr. They are pretty nice but conform to the old apis. Is there any similar example I can refer to for solr-4.3.0.
Your best bet is to download the Solr source and check the existing implementations Of RequestHandlers. There are some that are quiet simplistic and can give you a good grasp of the API and a starting point.PingRequestHandler comes first to mind, if your goal is to do something very simple. For more complex scenarios look for the ones that make use of components and take a look in solr config for their initialization parameters.
Best of luck!

White labeling CakePHP: What's the best way to provide customization hooks/callbacks to implementers?

I'm developing a CakePHP application that we will provide as a white label for people to implement for their own companies, and they'll need to have certain customization capabilities for themselves.
For starters, they'll be able to do anything they want with the views, and they can add their own Controllers/Models if they need to add completely new stuff. However, I'd rather advise against touching my controllers and models, to make version upgrading easier.
Esentially, the customization capabilities I'm planning to give them are going to be quite basic, I just need to call "something" when certain things happen, so they can do things like update external systems, e-mail themselves/the clients, things like that.
I'm wondering what's the best way to do this?
My plan is to have a "file" (with one class) for each controller of mine, to keep things reasonably organized. This file will have a bunch of empty methods that my code will call, and they'll be able to add code inside those methods to do whatever they need to do.
The specific question is, should this class full of empty methods be a Component? A Controller? Just a regular plain PHP class?
I'll need to call methods in this class from my Controllers, so I'm guessing making it a Controller is out of the question (unless maybe it's a controller that inherits from mine? or mine inherits from theirs, probably).
Also, I'd need the implementer of these methods to have access to my Models and Components, although I'm ok with making them use App::Import, I don't need to have the magic $this->ModelName members set.
Also, does this file I create (etiher Component or Controller) have to live in the app folder next to the other (my) controllers/components? Or can I throw it somewhere separate like the vendors folder?
Have you done something like this before?
Any tips/advice/pitfalls to avoid will be more than welcome.
I know this is kind of subjective, I'm looking to hear from your experience mostly, if you've done this before.
Thanks!
Two ideas that spring to mind:
create abstract templates (controllers, models, whatever necessary) that your clients can extend
write your controllers/components/models as a plugin within their own namespace
Ultimately you seem to want to provide an "enhanced" Cake framework, that your clients still have to write their own Cake code in (I don't know how this goes together with your idea of "basic customization capabilities" though). As such, you should write your code in as much an "optional" manner as possible (namespaced plugins, components, AppModel enhancements, extra libs) and provide documentation on how to use these to help your clients speed up their work.
I would setup a common set of events and use something like the linked to event system to handle this.
That lets the clients manage the event handler classes (read the readme to see what I mean) and subscribe to and broadcast events application-wide.
Also - if you want to have your users not muck about with your core functionality I recommend you package your main app as a plugin.
http://github.com/m3nt0r/eventful-cakephp

SSIS - creating a custom connection manager

Anyone aware of guidance on creating a custom SSIS connection manager? I want to abstract the complexities of a source system for the folks that need to extract data out of it using SSIS.
The MSDN tutorial is probably not a bad place to start. I haven't tried using their examples to implement a custom connection manager, but I was able to follow their documentation on custom data flow components to create a few of those without too much fuss in the past, so hopefully the connection manager examples are on the same level. I also found this example, which is probably a little more extensive code-wise since it was actually developed for use.
Keep in mind (as they mention on the MSDN page) that custom connection managers don't always play nice with the built-in components, so you often have to create custom data source components as well. Information about developing those seems to be more common at least, probably because actually parsing the source data tends to be a more varied task than setting up the connection.
Is it a one-off package, or intended to be reusable? If the latter, you could simply use a script as a source component (per this example). If it needs limited re-use, copy/paste may be good enough; if not then perhaps a custom component (example here) would do the trick.

Resources